feat: frontend validation

This commit is contained in:
2025-03-21 13:44:42 +00:00
parent 72a3e58ef9
commit 5b794b2e7f

View File

@ -47,6 +47,14 @@ export const sendImage = async (
return parse(sendImageResponseValidator, res);
};
const locationValidator = object({
ID: pipe(string(), uuid()),
Name: string(),
Address: nullable(string()),
Coordinates: nullable(string()),
Description: nullable(string()),
});
const getUserImagesResponseValidator = array(
object({
ID: pipe(string(), uuid()),
@ -88,6 +96,17 @@ const getUserImagesResponseValidator = array(
}),
),
),
Locations: nullable(array(locationValidator)),
Events: nullable(
array(
object({
ID: pipe(string(), uuid()),
Name: string(),
Description: nullable(string()),
Location: nullable(locationValidator),
}),
),
),
}),
);