diff --git a/app/creator/create/layout.tsx b/app/creator/create/[[...id]]/layout.tsx similarity index 93% rename from app/creator/create/layout.tsx rename to app/creator/create/[[...id]]/layout.tsx index 7939300..b593bf5 100644 --- a/app/creator/create/layout.tsx +++ b/app/creator/create/[[...id]]/layout.tsx @@ -1,5 +1,5 @@ import React from "react"; -import DefaultSEO from "../../seo"; +import DefaultSEO from "../../../seo"; import Script from "next/script"; export const metadata = { diff --git a/app/services/axios/requests/GetPlaceDetailsByPlaceId/index.ts b/app/services/axios/requests/GetPlaceDetailsByPlaceId/index.ts deleted file mode 100644 index 0e2ec95..0000000 --- a/app/services/axios/requests/GetPlaceDetailsByPlaceId/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ResultAsync } from "neverthrow"; -import axios from "axios"; - -interface GooglePlaceDetailsResponse { - result: { - formatted_address?: string; - address_components?: any; - url?: string; - name?: string; - }; -} - -/** - * Get Google place's details by a given place ID. - * @param placeId The place ID to get the details of. - * @returns The place's details. - */ -const GetPlaceDetailsByPlaceId = ( - placeId: string, -): ResultAsync => { - return ResultAsync.fromPromise( - axios.get( - `https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&fields=formatted_address%2Caddress_components%2Cname%2Curl&key=${process.env.NEXT_PUBLIC_GOOGLE_PLACES_API_KEY}`, - { - withCredentials: true, - headers: { - "Access-Control-Allow-Origin": "*", // Required for CORS support to work - }, - }, - ), - (e: any) => e ?? Error("Error retrieving place details"), - ).map((response) => response.data); -}; - -export default GetPlaceDetailsByPlaceId; diff --git a/next.config.js b/next.config.js index 26107f4..8790d39 100644 --- a/next.config.js +++ b/next.config.js @@ -12,6 +12,10 @@ const nextConfig = { }, ], }, + compiler: { + removeConsole: + process.env.NODE_ENV === "production" ? { exclude: ["error"] } : false, + }, }; module.exports = nextConfig;