feat: frontend validation
This commit is contained in:
@ -47,6 +47,14 @@ export const sendImage = async (
|
|||||||
return parse(sendImageResponseValidator, res);
|
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(
|
const getUserImagesResponseValidator = array(
|
||||||
object({
|
object({
|
||||||
ID: pipe(string(), uuid()),
|
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),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user