2023-10-11 19:32:02 +00:00
|
|
|
import { SchemaOf, array, object, number, string } from 'yup';
|
|
|
|
|
2024-04-08 14:22:43 +00:00
|
|
|
import { Registry } from '@/react/portainer/registries/types/registry';
|
2023-10-11 19:32:02 +00:00
|
|
|
|
|
|
|
export const registriesValidationSchema: SchemaOf<Registry[]> = array(
|
|
|
|
object({
|
|
|
|
Id: number().required('Registry ID is required.'),
|
|
|
|
Name: string().required('Registry name is required.'),
|
2024-04-08 14:22:43 +00:00
|
|
|
}) as unknown as SchemaOf<Registry>
|
|
|
|
// the only needed value is actually the id. SchemaOf throw a ts error if we don't cast to SchemaOf<Registry>
|
2023-10-11 19:32:02 +00:00
|
|
|
);
|