From b17727026a7db08e6c6953e71de083fa368731da Mon Sep 17 00:00:00 2001 From: Graham Mather Date: Wed, 11 Dec 2024 10:52:19 -0500 Subject: [PATCH] CompanyName error nav bug --- src/components/Profile/ControlledTimePicker.tsx | 3 --- src/pages/profile/index.tsx | 3 ++- src/pages/profile/setup.tsx | 1 + src/utils/profile/updateUser.ts | 8 ++++---- src/utils/publicUser.ts | 5 ++++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/Profile/ControlledTimePicker.tsx b/src/components/Profile/ControlledTimePicker.tsx index db7bf56d..db9bd718 100644 --- a/src/components/Profile/ControlledTimePicker.tsx +++ b/src/components/Profile/ControlledTimePicker.tsx @@ -46,9 +46,6 @@ const ControlledTimePicker = (props: ControlledTimePickerProps) => { name={props.name} control={props.control} render={({ field: { ref, ...fieldProps }, fieldState }) => { - if (fieldState.error) { - console.log("Error in TimePicker:", fieldState.error); - } return ( { }; const onError = (errors: FieldErrors) => { const firstErrorKey = Object.keys(errors)[0]; - + console.log(firstErrorKey); if (firstErrorKey) { if ( ["preferredName", "pronouns", "role", "bio", "seatAvail"].includes( @@ -184,6 +184,7 @@ const Index: NextPage = () => { [ "startAddress", "companyAddress", + "companyName", "startTime", "endTime", "daysWorking", diff --git a/src/pages/profile/setup.tsx b/src/pages/profile/setup.tsx index b10954f0..e4d96f1d 100644 --- a/src/pages/profile/setup.tsx +++ b/src/pages/profile/setup.tsx @@ -153,6 +153,7 @@ const Setup: NextPage = () => { startCoordLat: startAddressHook.selectedAddress.center[1], seatAvail: values.role === "RIDER" ? 0 : values.seatAvail, }; + console.log(userInfo); if (selectedFile) { try { await uploadFile(); diff --git a/src/utils/profile/updateUser.ts b/src/utils/profile/updateUser.ts index 2f6392f7..28ac02bb 100644 --- a/src/utils/profile/updateUser.ts +++ b/src/utils/profile/updateUser.ts @@ -26,11 +26,11 @@ export const updateUser = async ({ seatAvail: userInfo.seatAvail, companyName: userInfo.companyName, companyAddress: userInfo.companyAddress, - companyCoordLng: userInfo.companyCoordLng!, - companyCoordLat: userInfo.companyCoordLat!, + companyCoordLng: userInfo.companyCoordLng, + companyCoordLat: userInfo.companyCoordLat, startAddress: userInfo.startAddress, - startCoordLng: userInfo.startCoordLng!, - startCoordLat: userInfo.startCoordLat!, + startCoordLng: userInfo.startCoordLng, + startCoordLat: userInfo.startCoordLat, isOnboarded: true, preferredName: userInfo.preferredName || sessionName, pronouns: userInfo.pronouns, diff --git a/src/utils/publicUser.ts b/src/utils/publicUser.ts index 28c461a0..1b0690fc 100644 --- a/src/utils/publicUser.ts +++ b/src/utils/publicUser.ts @@ -52,6 +52,8 @@ export const generatePoiData = async ( longitude: number, latitude: number ): Promise => { + console.log(longitude + "\n" + latitude); + const endpoint = [ "https://api.mapbox.com/geocoding/v5/mapbox.places/", longitude, @@ -60,10 +62,11 @@ export const generatePoiData = async ( ".json?types=poi&access_token=", serverEnv.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN, ].join(""); - + console.log(endpoint); const data = await fetch(endpoint) .then((response) => response.json()) .catch((err) => { + console.log("throwing here?"); throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", message: "Unexpected error. Please try again.",