feat(notes): allowing frontend to save

This commit is contained in:
2025-04-01 20:54:15 +00:00
parent a385ef21cf
commit 393eaea2f4
5 changed files with 45 additions and 11 deletions

View File

@@ -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>;