Merge branch 'dev' into features/adminImplement

This commit is contained in:
p2405951
2026-01-13 12:10:33 +01:00
51 changed files with 874 additions and 283 deletions
+22
View File
@@ -0,0 +1,22 @@
export default async function searchUsers(query) {
try {
const encodedQuery = encodeURIComponent(query);
const response = await fetch(
`http://localhost:80/api/users/search?query=${encodedQuery}`,
{
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
const data = await response.json();
return data.hits.map(hit => hit.document);
} catch (err) {
console.error("Erreur :", err);
return null;
}
}