diff --git a/frontend/src/network/index.ts b/frontend/src/network/index.ts index 5d4a9fe..4e5007f 100644 --- a/frontend/src/network/index.ts +++ b/frontend/src/network/index.ts @@ -19,7 +19,9 @@ type BaseRequestParams = Partial<{ method: "GET" | "POST"; }>; -export const base = "https://haystack.johncosta.tech"; +export const base = import.meta.env.DEV + ? "http://localhost:3040" + : "https://haystack.johncosta.tech"; const getBaseRequest = ({ path, body, method }: BaseRequestParams): Request => { return new Request(`${base}/${path}`, { @@ -87,9 +89,9 @@ const eventValidator = strictObject({ EndDateTime: nullable(pipe(string())), Description: nullable(string()), LocationID: nullable(pipe(string(), uuid())), + Location: nullable(locationValidator), OrganizerID: nullable(pipe(string(), uuid())), - // Location: nullable(locationValidator), - // Organizer: nullable(contactValidator), + Organizer: nullable(contactValidator), }); const noteValidator = strictObject({ @@ -132,12 +134,8 @@ export type UserImage = InferOutput; export const getUserImages = async (): Promise => { const request = getBaseAuthorizedRequest({ path: "image" }); - console.log("DBG: ", request); - const res = await fetch(request).then((res) => res.json()); - console.log("DBG: ", res); - return parse(getUserImagesResponseValidator, res); };