feat(notes): allowing frontend to save
This commit is contained in:
@@ -75,6 +75,13 @@ const eventValidator = strictObject({
|
||||
Organizer: nullable(contactValidator),
|
||||
});
|
||||
|
||||
const noteValidator = strictObject({
|
||||
ID: pipe(string(), uuid()),
|
||||
Name: string(),
|
||||
Description: nullable(string()),
|
||||
Content: string(),
|
||||
});
|
||||
|
||||
const locationDataType = strictObject({
|
||||
type: literal("location"),
|
||||
data: locationValidator,
|
||||
@@ -85,7 +92,16 @@ const eventDataType = strictObject({
|
||||
data: eventValidator,
|
||||
});
|
||||
|
||||
const dataTypeValidator = variant("type", [locationDataType, eventDataType]);
|
||||
const noteDataType = strictObject({
|
||||
type: literal("note"),
|
||||
data: noteValidator,
|
||||
});
|
||||
|
||||
const dataTypeValidator = variant("type", [
|
||||
locationDataType,
|
||||
eventDataType,
|
||||
noteDataType,
|
||||
]);
|
||||
const getUserImagesResponseValidator = array(dataTypeValidator);
|
||||
|
||||
export type UserImage = InferOutput<typeof dataTypeValidator>;
|
||||
|
||||
Reference in New Issue
Block a user