mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
feat: Création nouveau style / pagination profils annuaires
This commit is contained in:
@ -9,7 +9,7 @@ import {
|
||||
BE_AUTH_NEW_PASSWORD_URL,
|
||||
FE_USERS_LOGIN_URL,
|
||||
} from '@/utils/Url';
|
||||
import logger from '@/utils/logger';
|
||||
import { PARENT_FILTER } from '@/utils/constants';
|
||||
|
||||
const requestResponseHandler = async (response) => {
|
||||
const body = await response.json();
|
||||
@ -73,10 +73,21 @@ export const disconnect = () => {
|
||||
signOut({ callbackUrl: FE_USERS_LOGIN_URL });
|
||||
};
|
||||
|
||||
export const fetchProfileRoles = (establishment) => {
|
||||
return fetch(
|
||||
`${BE_AUTH_PROFILES_ROLES_URL}?establishment_id=${establishment}`
|
||||
).then(requestResponseHandler);
|
||||
export const fetchProfileRoles = (
|
||||
establishment,
|
||||
filter = PARENT_FILTER,
|
||||
page = '',
|
||||
pageSize = ''
|
||||
) => {
|
||||
let url = `${BE_AUTH_PROFILES_ROLES_URL}?filter=${filter}&establishment_id=${establishment}`;
|
||||
if (page !== '' && pageSize !== '') {
|
||||
url = `${BE_AUTH_PROFILES_ROLES_URL}?filter=${filter}&establishment_id=${establishment}&page=${page}&search=${search}`;
|
||||
}
|
||||
return fetch(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
}).then(requestResponseHandler);
|
||||
};
|
||||
|
||||
export const updateProfileRoles = (id, data, csrfToken) => {
|
||||
|
||||
Reference in New Issue
Block a user