Skip to content

Commit

Permalink
chore: fix CheckNamespaceByUIDAdmin bug (#229)
Browse files Browse the repository at this point in the history
Because

- The `CheckNamespaceByUIDAdmin` should use UID to query.

This commit

- Fixes the bug.
  • Loading branch information
donch1989 authored Jul 26, 2024
1 parent 274d365 commit 2f20c64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/handler/privatehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (h *PrivateHandler) CheckNamespaceAdmin(ctx context.Context, req *mgmtPB.Ch

func (h *PrivateHandler) CheckNamespaceByUIDAdmin(ctx context.Context, req *mgmtPB.CheckNamespaceByUIDAdminRequest) (*mgmtPB.CheckNamespaceByUIDAdminResponse, error) {

user, err := h.Service.GetUserAdmin(ctx, req.GetUid())
user, err := h.Service.GetUserByUIDAdmin(ctx, uuid.FromStringOrNil(req.GetUid()))
if err == nil {
return &mgmtPB.CheckNamespaceByUIDAdminResponse{
Type: mgmtPB.CheckNamespaceByUIDAdminResponse_NAMESPACE_USER,
Expand All @@ -201,7 +201,7 @@ func (h *PrivateHandler) CheckNamespaceByUIDAdmin(ctx context.Context, req *mgmt
},
}, nil
}
org, err := h.Service.GetOrganizationAdmin(ctx, req.GetUid())
org, err := h.Service.GetOrganizationByUIDAdmin(ctx, uuid.FromStringOrNil(req.GetUid()))
if err == nil {
return &mgmtPB.CheckNamespaceByUIDAdminResponse{
Type: mgmtPB.CheckNamespaceByUIDAdminResponse_NAMESPACE_ORGANIZATION,
Expand Down

0 comments on commit 2f20c64

Please sign in to comment.