Skip to content

Commit

Permalink
[frontend] handle validation schema for sync and ingestion rss too
Browse files Browse the repository at this point in the history
  • Loading branch information
helene-nguyen committed Nov 8, 2023
1 parent a4ec7c3 commit 520810d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ingestionRssValidation = (t) => Yup.object().shape({
object_marking_refs: Yup.array().nullable(),
report_types: Yup.array().nullable(),
created_by_ref: Yup.mixed().nullable(),
user_id: Yup.object().nullable(),
user_id: Yup.mixed().nullable(),
current_state_date: Yup.date()
.typeError(t('The value must be a datetime (yyyy-MM-dd hh:mm (a|p)m)'))
.nullable(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ const ingestionTaxiiValidation = (t) => Yup.object().shape({
cert: Yup.string().nullable(),
key: Yup.string().nullable(),
ca: Yup.string().nullable(),
user_id: Yup.lazy((value) => {
switch (typeof value) {
case 'object':
return Yup.object().nullable(); // schema for object
case 'string':
return Yup.string().nullable();
default:
return Yup.mixed();
}
}),
user_id: Yup.mixed().nullable(),
added_after_start: Yup.date()
.typeError(t('The value must be a datetime (yyyy-MM-dd hh:mm (a|p)m)'))
.nullable(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const syncValidation = (t) => Yup.object().shape({
no_dependencies: Yup.bool(),
ssl_verify: Yup.bool(),
synchronized: Yup.bool(),
user_id: Yup.object().nullable(),
user_id: Yup.mixed().nullable(),
});

const SyncEditionContainer = ({ synchronizer }) => {
Expand Down

0 comments on commit 520810d

Please sign in to comment.