Skip to content
Snippets Groups Projects
Verified Commit 479e217c authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Reload guests on identity verification

parent a755a7e4
No related branches found
No related tags found
1 merge request!180Bugfix/reload guests on verify
......@@ -10,14 +10,21 @@ interface IdentityLineProps {
text: string
identity: Identity | null
reloadGuest: () => void
reloadGuests: () => void
}
const IdentityLine = ({ text, identity, reloadGuest }: IdentityLineProps) => {
const IdentityLine = ({
text,
identity,
reloadGuest,
reloadGuests,
}: IdentityLineProps) => {
// Make a line with a confirmation button if the identity has not been verified
const [confirmOpen, setConfirmOpen] = useState(false)
const [t] = useTranslation('common')
const verifyIdentity = (id: string) => async () => {
await fetch(`/api/ui/v1/identity/${id}`, submitJsonOpts('PATCH', {}))
reloadGuest()
reloadGuests()
}
if (identity == null) {
......
......@@ -235,11 +235,13 @@ export default function GuestInfo({
text={t('input.nationalIdNumber')}
identity={guest.fnr}
reloadGuest={reloadGuest}
reloadGuests={reloadGuests}
/>
<IdentityLine
text={t('input.passportNumber')}
identity={guest.passport}
reloadGuest={reloadGuest}
reloadGuests={reloadGuests}
/>
<TableRow>
<TableCell align="left">{t('input.mobilePhone')}</TableCell>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment