From 4148d76959c4fbe7f5499f7f93eb40000729a690 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Mon, 11 Mar 2024 09:21:36 +0100 Subject: [PATCH] Adding set for secretary and correcting self --- frontend/src/rest/Users.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/src/rest/Users.js b/frontend/src/rest/Users.js index 6c5f0f9..b3dac2d 100644 --- a/frontend/src/rest/Users.js +++ b/frontend/src/rest/Users.js @@ -18,6 +18,25 @@ export async function getUser(id){ return restGet(endpoint); } +/** + * Alterable datas of user. + * usage by secretary + * + * @param id regno of the user + * @param data data to change + * + * - lastName + * - firstName + * - birthDate + * - role + * - email + * - photo + * - Adress + */ +export async function alterUser(id, data){ + return restPatch("/user/" + id, data); +} + /** * Reserved for secretary roles. Allow to list all user on the plateform */ @@ -46,5 +65,5 @@ export async function getSelf(){ * - Adress */ export async function alterSelf(data){ - return restPatch({data}); + return restPatch("/user", data); }