mirror of
https://github.com/strapi/strapi.git
synced 2025-09-15 19:39:06 +00:00
17 lines
467 B
TypeScript
17 lines
467 B
TypeScript
import * as yup from 'yup';
|
|
|
|
export const RELEASE_SCHEMA = yup
|
|
.object()
|
|
.shape({
|
|
name: yup.string().trim().required(),
|
|
// scheduledAt is a date, but we always receive strings from the client
|
|
scheduledAt: yup.string().nullable(),
|
|
timezone: yup.string().when('scheduledAt', {
|
|
is: (scheduledAt: string) => !!scheduledAt,
|
|
then: yup.string().required(),
|
|
otherwise: yup.string().nullable(),
|
|
}),
|
|
})
|
|
.required()
|
|
.noUnknown();
|