2023-12-01 09:27:16 +01:00
|
|
|
import * as yup from 'yup';
|
|
|
|
|
|
|
|
export const RELEASE_SCHEMA = yup
|
|
|
|
.object()
|
|
|
|
.shape({
|
|
|
|
name: yup.string().trim().required(),
|
2024-02-08 14:24:12 +01:00
|
|
|
scheduledAt: yup.string().nullable(),
|
2024-02-20 05:32:14 +01:00
|
|
|
isScheduled: yup.boolean().optional(),
|
|
|
|
time: yup.string().when('isScheduled', {
|
|
|
|
is: true,
|
|
|
|
then: yup.string().trim().required(),
|
|
|
|
otherwise: yup.string().nullable(),
|
|
|
|
}),
|
|
|
|
timezone: yup.string().when('isScheduled', {
|
|
|
|
is: true,
|
|
|
|
then: yup.string().required().nullable(),
|
|
|
|
otherwise: yup.string().nullable(),
|
|
|
|
}),
|
|
|
|
date: yup.string().when('isScheduled', {
|
|
|
|
is: true,
|
|
|
|
then: yup.string().required().nullable(),
|
2024-02-13 14:19:57 +01:00
|
|
|
otherwise: yup.string().nullable(),
|
|
|
|
}),
|
2023-12-01 09:27:16 +01:00
|
|
|
})
|
|
|
|
.required()
|
|
|
|
.noUnknown();
|