feat: Champ de recherche de l'élève [#16]

This commit is contained in:
N3WT DE COMPET
2025-05-20 20:22:58 +02:00
parent 56c223f3cc
commit eb7805e54e
7 changed files with 181 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import {
BE_SUBSCRIPTION_LAST_GUARDIAN_ID_URL,
BE_SUBSCRIPTION_ABSENCES_URL,
BE_SUBSCRIPTION_STUDENT_COMPETENCIES_URL,
BE_SUBSCRIPTION_SEARCH_STUDENTS_URL,
} from '@/utils/Url';
import { CURRENT_YEAR_FILTER } from '@/utils/constants';
@ -128,6 +129,18 @@ export const archiveRegisterForm = (id) => {
.catch(errorHandler);
};
export const searchStudents = (establishmentId, query) => {
const url = `${BE_SUBSCRIPTION_SEARCH_STUDENTS_URL}/?establishment_id=${establishmentId}&q=${encodeURIComponent(query)}`;
return fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.then(requestResponseHandler)
.catch(errorHandler);
};
export const fetchStudents = (establishment, id = null, status = null) => {
let url;
if (id) {