Skip to content

Commit

Permalink
feat(dashboard): création d'utilisateurs plus rapide avec valeurs par…
Browse files Browse the repository at this point in the history
… défaut et possiblité d'enchainer les uns après les autres rapidement
  • Loading branch information
Arnaud AMBROSELLI committed Oct 3, 2023
1 parent a83adb0 commit 335f43b
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 142 deletions.
2 changes: 1 addition & 1 deletion api/src/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ router.post(
};

const prevUser = await User.findOne({ where: { email: newUser.email } });
if (prevUser) return res.status(400).send({ ok: false, error: "A user already exists with this email" });
if (prevUser) return res.status(400).send({ ok: false, error: "Un utilisateur existe déjà avec cet email" });

const data = await User.create(newUser, { returning: true });

Expand Down
10 changes: 0 additions & 10 deletions dashboard/src/components/createWrapper.js

This file was deleted.

5 changes: 2 additions & 3 deletions dashboard/src/scenes/place/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { toast } from 'react-toastify';
import { SmallHeader } from '../../components/header';
import ButtonCustom from '../../components/ButtonCustom';
import Loading from '../../components/loading';
import CreateWrapper from '../../components/createWrapper';
import Table from '../../components/table';
import Search from '../../components/search';
import Page from '../../components/pagination';
Expand Down Expand Up @@ -110,7 +109,7 @@ const Create = () => {
const setPlaces = useSetRecoilState(placesState);

return (
<CreateWrapper style={{ marginBottom: 0 }}>
<div className="tw-flex tw-w-full tw-justify-end">
<ButtonCustom
disabled={!currentTeam}
onClick={() => setOpen(true)}
Expand Down Expand Up @@ -152,7 +151,7 @@ const Create = () => {
</Formik>
</ModalBody>
</Modal>
</CreateWrapper>
</div>
);
};

Expand Down
5 changes: 2 additions & 3 deletions dashboard/src/scenes/team/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';

import { SmallHeader } from '../../components/header';
import ButtonCustom from '../../components/ButtonCustom';
import CreateWrapper from '../../components/createWrapper';
import Table from '../../components/table';
import NightSessionModale from '../../components/NightSessionModale';
import { currentTeamState, organisationState, teamsState, userState } from '../../recoil/auth';
Expand Down Expand Up @@ -99,7 +98,7 @@ const Create = () => {
const onboardingForTeams = !teams.length;

return (
<CreateWrapper>
<div className="tw-mb-10 tw-flex tw-w-full tw-justify-end">
<ButtonCustom color="primary" onClick={() => setOpen(true)} title="Créer une nouvelle équipe" padding="12px 24px" />
<Modal isOpen={open} toggle={() => setOpen(false)} size="lg" backdrop="static">
<ModalHeader close={onboardingForTeams ? <></> : null} toggle={() => setOpen(false)}>
Expand Down Expand Up @@ -201,7 +200,7 @@ const Create = () => {
</ModalBody>
</Modal>
<OnboardingEndModal open={onboardingEndModalOpen} setOpen={setOnboardingEndModalOpen} />
</CreateWrapper>
</div>
);
};

Expand Down
Loading

0 comments on commit 335f43b

Please sign in to comment.