Skip to content

Comments

Weather Charts - Redux Eval#9

Open
PeytonLamb wants to merge 3 commits intoprojectshft:mainfrom
PeytonLamb:main
Open

Weather Charts - Redux Eval#9
PeytonLamb wants to merge 3 commits intoprojectshft:mainfrom
PeytonLamb:main

Conversation

@PeytonLamb
Copy link

Having an issue with "useReducer" somewhere within Next.js that I can't figure out. Code was working fine until I did something funky with "npm install @latest" on react/redux/next and now its bungled, but if you read my code hopefully it makes enough sense for now. Will come back to clean up

"dependencies": {
"eslint": "8.50.0",
"@reduxjs/toolkit": "^2.2.3",
"bootstrap": "^5.3.3",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing axios as a dependency

console.log(response)
return response.data
} catch (error) {
console.log('ur a bad coder')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console logs as they are just used for troubleshooting - and not a bad coder, just need more practice :)

export const fetchWeatherData = createAsyncThunk(
'weather/fetchWeatherData', async (city) => {
try {
const response = await axios.get(`https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=4d2230e28dd5ff342317c6687cd2d078`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend adding appid as a variable here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants