Need help with "Expense Tracker" lesson

I could use some help with the “Expense Tracker” lesson, I don’t think I’ve set up the “createSlice” function call for the “budgetSlice” correctly:

const budgetsSlice = createSlice({
name : “budgets”,
initialState: initialState,
reducers: {
editBudget : (state, action) => {
console.log(“action.payload” + action);
state.budgets.find(budget => budget.category === action.payload.category).amount = action.payload.amount;
}
}
});

.find returns the first element that passes the test, your probably manipulating a copy of the object from the array. not the object in the array. to do that find the index of the object and edit value from there.

const index = state.budgets.findIndex((obj) => obj.category === action.payload.category)
state.budgets[index].amout = action.payload.amout