Skip to content

Commit

Permalink
Simplify validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens committed Aug 22, 2024
1 parent aa5be45 commit 8419df1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2024 Gemeente Amsterdam
import {
falsyOrNumberOrNow,
inPast,
} from 'signals/incident/services/custom-validators'
import { inPast } from 'signals/incident/services/custom-validators'
import { QuestionFieldType } from 'types/question'

import locatie from './locatie'
Expand All @@ -16,7 +13,7 @@ export const controls = {
canBeNull: true,
},
options: {
validators: [falsyOrNumberOrNow, inPast, 'required'],
validators: [inPast, 'required'],
},
render: QuestionFieldType.DateTimeInput,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2021 - 2024 Gemeente Amsterdam
import {
falsyOrNumberOrNow,
inPast,
} from 'signals/incident/services/custom-validators'
import { inPast } from 'signals/incident/services/custom-validators'
import { QuestionFieldType } from 'types/question'

import locatie from './locatie'
Expand All @@ -23,7 +20,7 @@ export const overlastOpHetWater = {
},
},
options: {
validators: [falsyOrNumberOrNow, inPast, 'required'],
validators: [inPast, 'required'],
},
render: QuestionFieldType.DateTimeInput,
},
Expand All @@ -42,7 +39,7 @@ export const overlastOpHetWater = {
},
},
options: {
validators: [falsyOrNumberOrNow, inPast, 'required'],
validators: [inPast, 'required'],
},
render: QuestionFieldType.DateTimeInput,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2018 - 2024 Gemeente Amsterdam
import {
falsyOrNumberOrNow,
inPast,
} from 'signals/incident/services/custom-validators'
import { inPast } from 'signals/incident/services/custom-validators'
import { QuestionFieldType } from 'types/question'

import locatie from './locatie'
Expand All @@ -29,7 +26,7 @@ export const overlastPersonenEnGroepen = {
canBeNull: true,
},
options: {
validators: [falsyOrNumberOrNow, inPast, 'required'],
validators: [inPast, 'required'],
},
render: QuestionFieldType.DateTimeInput,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2018 - 2024 Gemeente Amsterdam
import {
falsyOrNumberOrNow,
inPast,
} from 'signals/incident/services/custom-validators'
import { inPast } from 'signals/incident/services/custom-validators'
import { QuestionFieldType } from 'types/question'

import locatie from './locatie'
Expand All @@ -16,7 +13,7 @@ export const verkeersoverlast = {
canBeNull: true,
},
options: {
validators: [falsyOrNumberOrNow, inPast, 'required'],
validators: [inPast, 'required'],
},
render: QuestionFieldType.DateTimeInput,
},
Expand Down

0 comments on commit 8419df1

Please sign in to comment.