diff --git a/components/LocationSearch.tsx b/components/LocationSearch.tsx index 048aa31..0c275e5 100644 --- a/components/LocationSearch.tsx +++ b/components/LocationSearch.tsx @@ -1,6 +1,6 @@ "use client"; import React, { useContext, useState } from "react"; -import { getLocation } from "@/app/actions"; +import { getLocation } from "@/pages/api/actions"; import { LocationContext } from "@/context/LocationContext"; export default function LocationSearch() { @@ -25,18 +25,18 @@ export default function LocationSearch() { }; return ( -
- -
+
+ +
); } diff --git a/components/WeatherNow.tsx b/components/WeatherNow.tsx index aa0e766..a685bd5 100644 --- a/components/WeatherNow.tsx +++ b/components/WeatherNow.tsx @@ -1,6 +1,6 @@ "use client"; -import { getHourlyForecast } from "@/app/actions"; +import { getHourlyForecast } from "@/pages/api/actions"; import Temperature from "./Temperature"; import { Forecast, WeatherContextType } from "@/types/types"; import { createContext, useContext, useEffect, useState } from "react"; @@ -15,7 +15,6 @@ export const WeatherContext = createContext({ setWeather: () => {}, // Default function, does nothing }); - export default function WeatherNow() { const { geoLocation } = useContext(LocationContext); const [weather, setWeather] = useState(defaultHourlyForecast); @@ -44,7 +43,7 @@ export default function WeatherNow() {

And the forecast for the coming week

- + ); diff --git a/app/actions.ts b/pages/api/actions.ts similarity index 98% rename from app/actions.ts rename to pages/api/actions.ts index 3ec9904..6028e73 100644 --- a/app/actions.ts +++ b/pages/api/actions.ts @@ -10,7 +10,7 @@ export async function getLocation(searchLocation: string): Promise { } const url = `https://maps.googleapis.com/maps/api/geocode/json?address=${searchLocation}&key=${placesKey}`; - console.log(`Fetching URL: ${url}`); + console.log(`Fetching location`); try { const res = await fetch(url);