2023-10-11 20:32:02 +01:00
|
|
|
import { SchemaOf, array, object, number, string } from 'yup';
|
|
|
|
|
2024-04-08 17:22:43 +03:00
|
|
|
import { Registry } from '@/react/portainer/registries/types/registry';
|
2023-10-11 20:32:02 +01: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 17:22:43 +03: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 20:32:02 +01:00
|
|
|
);
|