Skip to content

Commit

Permalink
chore(handler): fix update mask error
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Dec 8, 2023
1 parent acc97f9 commit bba6eb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/handler/publichandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ func (h *PublicHandler) UpdateOrganization(ctx context.Context, req *mgmtPB.Upda

pbOrgReq := req.GetOrganization()
pbUpdateMask := req.GetUpdateMask()
// profile_data field is type google.protobuf.Struct, which needs to be updated as a whole
for idx, path := range pbUpdateMask.Paths {
if strings.Contains(path, "profile_data") {
pbUpdateMask.Paths[idx] = "profile_data"
}
}

// Validate the field mask
if !pbUpdateMask.IsValid(pbOrgReq) {
Expand Down

0 comments on commit bba6eb7

Please sign in to comment.