fix: update the library scope according to the backend requirements

This commit is contained in:
Diana Olarte
2025-10-09 23:45:58 +11:00
committed by Adolfo R. Brandes
parent 78665d97a5
commit 9e2ab6d647
3 changed files with 6 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ export type PermissionsByRole = {
// TODO: replece api path once is created
export const getTeamMembers = async (object: string): Promise<TeamMember[]> => {
const { data } = await getAuthenticatedHttpClient().get(getApiUrl(`/api/authz/v1/roles/users?scope=${object}`));
const { data } = await getAuthenticatedHttpClient().get(getApiUrl(`/api/authz/v1/roles/users/?scope=${object}`));
return camelCaseObject(data.results);
};
@@ -32,8 +32,8 @@ export const getLibrary = async (libraryId: string): Promise<LibraryMetadata> =>
};
export const getPermissionsByRole = async (scope: string): Promise<PermissionsByRole[]> => {
const url = new URL(getApiUrl('/api/authz/v1/roles'));
const url = new URL(getApiUrl('/api/authz/v1/roles/'));
url.searchParams.append('scope', scope);
const { data } = await getAuthenticatedHttpClient().get(url);
return camelCaseObject(data);
return camelCaseObject(data.results);
};