Adding a check for existing accounts
This commit is contained in:
parent
a32faaa837
commit
51eb54954f
|
@ -28,6 +28,7 @@ const fetchInvitation = () => {
|
||||||
params: { id: invitation().data.id },
|
params: { id: invitation().data.id },
|
||||||
}).then((account) => {
|
}).then((account) => {
|
||||||
console.log({ caller: 'Invitation / fetchInvitation', account });
|
console.log({ caller: 'Invitation / fetchInvitation', account });
|
||||||
|
setInvitation({ ...invitation(), existing: true });
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -102,7 +103,7 @@ const Invitation: Component<props> = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleModalFailureClose = () => {
|
const handleModalFailureClose = () => {
|
||||||
setInvitation({ ...invitation(), failure: undefined });
|
setInvitation({ ...invitation(), failure: undefined, existing: undefined });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCloseAll = () => {
|
const handleCloseAll = () => {
|
||||||
|
@ -191,6 +192,31 @@ const Invitation: Component<props> = (props) => {
|
||||||
>
|
>
|
||||||
<Alert severity='success'>C'est tout bon !</Alert>
|
<Alert severity='success'>C'est tout bon !</Alert>
|
||||||
</Box>
|
</Box>
|
||||||
|
</Modal>{' '}
|
||||||
|
<Modal
|
||||||
|
open={!!invitation().existing}
|
||||||
|
onClose={handleModalFailureClose}
|
||||||
|
aria-labelledby='modal-modal-title'
|
||||||
|
aria-describedby='modal-modal-description'
|
||||||
|
>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '50%',
|
||||||
|
left: '50%',
|
||||||
|
transform: 'translate(-50%, -50%)',
|
||||||
|
width: 400,
|
||||||
|
border: '2px solid #000',
|
||||||
|
boxShadow: '24px',
|
||||||
|
p: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Alert severity='info'>
|
||||||
|
Ce compte est déjà configuré, vous pouvez soit continuer et le
|
||||||
|
reconfigurer soit abandonner cette action et ne pas tenir compte du
|
||||||
|
massage qui vous a été envoyé.
|
||||||
|
</Alert>
|
||||||
|
</Box>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue