feat(frontend): validators
This commit is contained in:
@ -87,6 +87,7 @@ const locationValidator = strictObject({
|
|||||||
Name: string(),
|
Name: string(),
|
||||||
Address: nullable(string()),
|
Address: nullable(string()),
|
||||||
Description: nullable(string()),
|
Description: nullable(string()),
|
||||||
|
Images: array(pipe(string(), uuid())),
|
||||||
});
|
});
|
||||||
|
|
||||||
const contactValidator = strictObject({
|
const contactValidator = strictObject({
|
||||||
@ -95,6 +96,7 @@ const contactValidator = strictObject({
|
|||||||
Description: nullable(string()),
|
Description: nullable(string()),
|
||||||
PhoneNumber: nullable(string()),
|
PhoneNumber: nullable(string()),
|
||||||
Email: nullable(string()),
|
Email: nullable(string()),
|
||||||
|
Images: array(pipe(string(), uuid())),
|
||||||
});
|
});
|
||||||
|
|
||||||
const eventValidator = strictObject({
|
const eventValidator = strictObject({
|
||||||
@ -107,6 +109,7 @@ const eventValidator = strictObject({
|
|||||||
// Location: nullable(locationValidator),
|
// Location: nullable(locationValidator),
|
||||||
OrganizerID: nullable(pipe(string(), uuid())),
|
OrganizerID: nullable(pipe(string(), uuid())),
|
||||||
// Organizer: nullable(contactValidator),
|
// Organizer: nullable(contactValidator),
|
||||||
|
Images: array(pipe(string(), uuid())),
|
||||||
});
|
});
|
||||||
|
|
||||||
const noteValidator = strictObject({
|
const noteValidator = strictObject({
|
||||||
@ -114,6 +117,7 @@ const noteValidator = strictObject({
|
|||||||
Name: string(),
|
Name: string(),
|
||||||
Description: nullable(string()),
|
Description: nullable(string()),
|
||||||
Content: string(),
|
Content: string(),
|
||||||
|
Images: array(pipe(string(), uuid())),
|
||||||
});
|
});
|
||||||
|
|
||||||
const locationDataType = strictObject({
|
const locationDataType = strictObject({
|
||||||
|
Reference in New Issue
Block a user