From 5b794b2e7fea58c3760acb9a6278b1bbc1e76430 Mon Sep 17 00:00:00 2001 From: John Costa Date: Fri, 21 Mar 2025 13:44:42 +0000 Subject: [PATCH] feat: frontend validation --- frontend/src/network/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/src/network/index.ts b/frontend/src/network/index.ts index 34ecad5..87fcad9 100644 --- a/frontend/src/network/index.ts +++ b/frontend/src/network/index.ts @@ -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), + }), + ), + ), }), );