text: export const fetchLocationId = async city => {
    const response = await fetch(
      `https://metaweather.com/api/location/search/?query=${city}`,
    );
    console.log(response);
    const locations = await response.json();
    return locations[0].woeid;
  };
  
  export const fetchWeather = async woeid => {
    const response = await fetch(
      `https://metaweather.com/api/location/${woeid}/`,
    );
    const { title, consolidated_weather } = await response.json();
    const { weather_state_name, the_temp } = consolidated_weather[0];
  
    return {
      location: title,
      weather: weather_state_name,
      temperature: the_temp,
    };
  };