Skip to content

Commit

Permalink
feat: clearing useless bits of code
Browse files Browse the repository at this point in the history
Signed-off-by: Léo-Paul HAUET <[email protected]>
  • Loading branch information
IC-1101asterisk committed Jul 24, 2023
1 parent c5fe572 commit a69836a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/api/UsersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export const deleteUser = (key: string): AxiosPromise<void> =>
API.delete(compilePath(API_PATHS.USER, { key }));

export const deleteUserAwaitingApproval = (key: string): AxiosPromise<void> =>
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
Expand Down
19 changes: 6 additions & 13 deletions src/routes/users/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,15 @@ const Users = (): JSX.Element => {
{isRequestAccepted && (
<Alert
status="info"
variant="subtle"
overflow="visible"
background="#C2DFFF"
paddingX="4"
paddingY="3"
padding="var(--chakra-space-3) var(--chakra-space-4)"
marginBottom="10"
>
<AlertIcon as={RiInformationLine} color="blue.900" />
<Box alignItems="stretch" width="100%" background="#C2DFFF">
<AlertTitle fontSize="xxs" color="blue.900">
Just accepted? Let them know!
</AlertTitle>
<AlertDescription
maxWidth="sm"
fontSize="xss"
color="blue.900"
>
<AlertIcon as={RiInformationLine} fill="blue.900" />
<Box>
<AlertTitle>Just accepted? Let them know!</AlertTitle>
<AlertDescription lineHeight="4">
Some users were successfully accepted. Don't forget
to notify them that they now have access to Substra.
</AlertDescription>
Expand Down
7 changes: 0 additions & 7 deletions src/routes/users/useUsersStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,6 @@ const useUsersStore = create<UsersStateT>((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) {
Expand Down

0 comments on commit a69836a

Please sign in to comment.