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) {