mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-05 05:42:16 +00:00
feat: delete metadata on SetOrganizationMetadata api (#11790)
# Which Problems Are Solved Currently, to delete an Organization metadata key, callers must use a separate [DeleteMetadata](https://zitadel.com/docs/reference/api/org/zitadel.org.v2.OrganizationService.DeleteOrganizationMetadata) API. This increases the complexity on client-side for operations where metadata need to be synchronized. # How the Problems Are Solved Introduce deletion behavior to [SetOrganizationMetadata](https://zitadel.com/docs/reference/api/org/zitadel.org.v2.OrganizationService.SetOrganizationMetadata): When a metadata entry is passed with an empty value ("" / empty bytes): - If the key exists → delete the key - If the key does not exist → no-op (idempotent, no error) # Additional Changes n/a # Additional Context Relates to #11776 --------- Co-authored-by: Gayathri Vijayan <[email protected]> Co-authored-by: Gayathri Vijayan <[email protected]>
This commit is contained in:
co-authored by
Gayathri Vijayan
Gayathri Vijayan
parent
8b90ddb0b5
commit
62cb5bbb83
@@ -76,6 +76,7 @@ func (c *Commands) BulkSetUserMetadata(ctx context.Context, userID, resourceOwne
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// no changes for the metadata
|
||||
if len(events) == 0 {
|
||||
return writeModelToObjectDetails(&setMetadata.WriteModel), nil
|
||||
|
||||
Reference in New Issue
Block a user