ci was never the issue. I was.
Some checks failed
Docker Build & Publish / Build Docker (push) Failing after 49s

This commit is contained in:
christian 2024-05-12 07:32:14 +02:00
parent 2c5831c683
commit 22f5fc125b

View File

@ -1,5 +1,5 @@
'use server'
import { Forecast, HourlyForecast, LocationType, coordType } from "@/types/types";
import { Forecast, LocationType, coordType } from "@/types/types";
//takes address and returns coords in obj as {lat: number, lng: number}
export async function getLocation(searchLocation: string): Promise<coordType>{
@ -18,7 +18,7 @@ export async function getLocation(searchLocation: string): Promise<coordType>{
export async function getHourlyForecast(geoLocation: coordType): Promise<HourlyForecast> {
export async function getHourlyForecast(geoLocation: coordType): Promise<Forecast> {
const { lat, lng } = geoLocation.geo;
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
const url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lng}&current=temperature_2m,apparent_temperature,is_day,precipitation,rain,showers,snowfall,weather_code,cloud_cover,wind_speed_10m,wind_direction_10m&hourly=temperature_2m,apparent_temperature,precipitation_probability,precipitation,weather_code,wind_speed_10m,is_day&daily=weather_code,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,daylight_duration,sunshine_duration,uv_index_max,precipitation_sum,precipitation_hours,wind_speed_10m_max&timezone=${tz}`
@ -26,6 +26,6 @@ export async function getHourlyForecast(geoLocation: coordType): Promise<HourlyF
if (!res.ok) {
throw new Error(`Failed to fetch the weather data`);
}
const data: HourlyForecast = await res.json();
const data: Forecast = await res.json();
return data;
}