UpdateUser delegates to service.UpdateUser and projects the updated user. Optional proto fields map 1:1 onto the model's nullable pointers. Requires super-admin auth.
(ctx context.Context, req *authorizerv1.UpdateUserRequest)
| 96 | // Optional proto fields map 1:1 onto the model's nullable pointers. Requires |
| 97 | // super-admin auth. |
| 98 | func (h *AdminHandler) UpdateUser(ctx context.Context, req *authorizerv1.UpdateUserRequest) (*authorizerv1.UpdateUserResponse, error) { |
| 99 | res, _, err := h.Service.UpdateUser(ctx, transport.MetaFromGRPC(ctx), &model.UpdateUserRequest{ |
| 100 | ID: req.GetId(), |
| 101 | Email: req.Email, |
| 102 | EmailVerified: req.EmailVerified, |
| 103 | GivenName: req.GivenName, |
| 104 | FamilyName: req.FamilyName, |
| 105 | MiddleName: req.MiddleName, |
| 106 | Nickname: req.Nickname, |
| 107 | Gender: req.Gender, |
| 108 | Birthdate: req.Birthdate, |
| 109 | PhoneNumber: req.PhoneNumber, |
| 110 | PhoneNumberVerified: req.PhoneNumberVerified, |
| 111 | Picture: req.Picture, |
| 112 | Roles: protoToModelStringSlice(req.GetRoles()), |
| 113 | IsMultiFactorAuthEnabled: req.IsMultiFactorAuthEnabled, |
| 114 | AppData: appDataToMap(req.GetAppData()), |
| 115 | }) |
| 116 | if err != nil { |
| 117 | return nil, err |
| 118 | } |
| 119 | return &authorizerv1.UpdateUserResponse{User: projectUser(res)}, nil |
| 120 | } |
| 121 | |
| 122 | // DeleteUser delegates to service.DeleteUser. Requires super-admin auth. |
| 123 | func (h *AdminHandler) DeleteUser(ctx context.Context, req *authorizerv1.DeleteUserRequest) (*authorizerv1.DeleteUserResponse, error) { |
nothing calls this directly
no test coverage detected