Skip to content

Commit

Permalink
fix: fix organization can not be updated (#233)
Browse files Browse the repository at this point in the history
Because

- The organization can not be updated.

This commit

- Fixes organization can not be updated.
  • Loading branch information
donch1989 authored Aug 1, 2024
1 parent 61df67c commit 1246071
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/handler/publichandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,6 @@ func (h *PublicHandler) UpdateOrganization(ctx context.Context, req *mgmtPB.Upda
return nil, err
}

id, err := resource.GetRscNameID(req.GetOrganization().Name)
if err != nil {
return nil, err
}

pbOrgReq := req.GetOrganization()
pbUpdateMask := req.GetUpdateMask()

Expand All @@ -545,7 +540,7 @@ func (h *PublicHandler) UpdateOrganization(ctx context.Context, req *mgmtPB.Upda
return nil, ErrUpdateMask
}

getResp, err := h.GetOrganization(ctx, &mgmtPB.GetOrganizationRequest{OrganizationId: pbOrgReq.Id})
getResp, err := h.GetOrganization(ctx, &mgmtPB.GetOrganizationRequest{OrganizationId: req.OrganizationId})
if err != nil {
span.SetStatus(1, err.Error())
return nil, err
Expand Down Expand Up @@ -578,7 +573,7 @@ func (h *PublicHandler) UpdateOrganization(ctx context.Context, req *mgmtPB.Upda
return nil, ErrFieldMask
}

pbOrg, err := h.Service.UpdateOrganization(ctx, ctxUserUID, id, pbOrgToUpdate)
pbOrg, err := h.Service.UpdateOrganization(ctx, ctxUserUID, req.OrganizationId, pbOrgToUpdate)

if err != nil {
return nil, err
Expand Down

0 comments on commit 1246071

Please sign in to comment.