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

Allow changing past start dates of roles in webui

Roles that have started could not be given start dates in the past in
the frontend. After this fix they now can.
parent c800ce78
No related branches found
No related tags found
1 merge request!248Allow changing past start dates of roles in webui
Pipeline #110551 passed
...@@ -77,10 +77,7 @@ export default function GuestRoleInfo({ guest }: GuestRoleInfoProps) { ...@@ -77,10 +77,7 @@ export default function GuestRoleInfo({ guest }: GuestRoleInfoProps) {
const submit: SubmitHandler<RoleFormData> = (data) => { const submit: SubmitHandler<RoleFormData> = (data) => {
const payload: { start_date?: string; end_date: string } = { const payload: { start_date?: string; end_date: string } = {
end_date: format(data.end_date as Date, 'yyyy-MM-dd'), end_date: format(data.end_date as Date, 'yyyy-MM-dd'),
} start_date: format(data.start_date as Date, 'yyyy-MM-dd'),
// Ignore start dates before today ()
if (data.start_date >= today) {
payload.start_date = format(data.start_date as Date, 'yyyy-MM-dd')
} }
console.log('submitting', JSON.stringify(payload)) console.log('submitting', JSON.stringify(payload))
......
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