Merge branch 'feature/user-info-with-role-permissions' into feature/users-roles-endpoint

This commit is contained in:
Pedro Costa
2025-04-29 19:27:39 +01:00
8 changed files with 82 additions and 46 deletions

View File

@@ -278,15 +278,13 @@ func (h *handler) getCurrentUser(w http.ResponseWriter, r *http.Request) {
return
}
accountID, userID := userAuth.AccountId, userAuth.UserId
user, err := h.accountManager.GetCurrentUserInfo(ctx, accountID, userID)
user, err := h.accountManager.GetCurrentUserInfo(ctx, userAuth)
if err != nil {
util.WriteError(r.Context(), err, w)
return
}
util.WriteJSONObject(r.Context(), w, toUserWithPermissionsResponse(user, userID))
util.WriteJSONObject(r.Context(), w, toUserWithPermissionsResponse(user, userAuth.UserId))
}
func (h *handler) getRoles(w http.ResponseWriter, r *http.Request) {