From a69836a18bd44879a5d38b0865e6a8cfc39d40bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o-Paul=20HAUET?= Date: Mon, 24 Jul 2023 11:07:06 +0200 Subject: [PATCH] feat: clearing useless bits of code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Léo-Paul HAUET --- src/api/UsersApi.ts | 6 +++--- src/routes/users/Users.tsx | 19 ++++++------------- src/routes/users/useUsersStore.tsx | 7 ------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/api/UsersApi.ts b/src/api/UsersApi.ts index c6dc285b..5f8a328e 100644 --- a/src/api/UsersApi.ts +++ b/src/api/UsersApi.ts @@ -55,9 +55,9 @@ export const deleteUser = (key: string): AxiosPromise => API.delete(compilePath(API_PATHS.USER, { key })); export const deleteUserAwaitingApproval = (key: string): AxiosPromise => - API.delete( - API_PATHS.USERS_AWAITING_APPROVAL.concat(`?username=`).concat(key) - ); + API.delete(API_PATHS.USERS_AWAITING_APPROVAL, { + params: { username: key }, + }); export const requestResetToken = ( key: string diff --git a/src/routes/users/Users.tsx b/src/routes/users/Users.tsx index 15203d41..0e38dd9f 100644 --- a/src/routes/users/Users.tsx +++ b/src/routes/users/Users.tsx @@ -104,22 +104,15 @@ const Users = (): JSX.Element => { {isRequestAccepted && ( - - - - Just accepted? Let them know! - - + + + Just accepted? Let them know! + Some users were successfully accepted. Don't forget to notify them that they now have access to Substra. diff --git a/src/routes/users/useUsersStore.tsx b/src/routes/users/useUsersStore.tsx index 7ef31fc5..fa8c663d 100644 --- a/src/routes/users/useUsersStore.tsx +++ b/src/routes/users/useUsersStore.tsx @@ -207,13 +207,6 @@ const useUsersStore = create((set, get) => ({ await deleteUserAwaitingApproval(key); set({ deletingUserAwaitingApproval: false, - usersAwaitingApprovalCount: - get().usersAwaitingApprovalCount - 1, - usersAwaitingApproval: get().usersAwaitingApproval.filter( - (userAwaitingApproval) => - userAwaitingApproval.username !== - get().userAwaitingApproval?.username - ), }); return null; } catch (error) {