Skip to content
Snippets Groups Projects
Commit dcba7779 authored by lass's avatar lass
Browse files

Make role-end null by default

parent 4f127a63
No related branches found
No related tags found
1 merge request!396Greg 334 fix
Pipeline #185447 passed
......@@ -305,9 +305,6 @@ function NewGuestRole({ guest, reloadGuestInfo }: NewGuestRoleProps) {
control={control}
rules={{
required: true,
validate: () =>
Number(getValues('start_date')) <=
Number(getValues('end_date')),
}}
render={({ field }) => (
<DatePicker
......
......@@ -3,7 +3,7 @@ export type RegisterFormData = {
last_name?: string
role_type?: number
role_start: Date
role_end: Date
role_end: Date | null
contact_person_unit?: string
comment?: string
ou_id?: number
......
......@@ -337,7 +337,7 @@ const StepPersonForm = forwardRef(
/>
)}
/>
{!!errors.role_end && errors.role_end.type === 'required' && (
{!!errors.role_end && (
<Box sx={{ typography: 'caption', color: 'red' }}>
{t('validation.roleEndRequired')}
</Box>
......
......@@ -38,9 +38,9 @@ export default function StepRegistration() {
first_name: undefined,
last_name: undefined,
role_type: undefined,
// Having role_start and role_end to be nullable caused problems when specifying a default value, so instead having them as non-null and use today as the default date here
// Having role_start to be nullable caused problems when specifying a default value, so instead having them as non-null and use today as the default date here
role_start: new Date(),
role_end: new Date(),
role_end: null,
comment: undefined,
ou_id: undefined,
email: undefined,
......
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