small fix
This commit is contained in:
@@ -27,6 +27,7 @@ export const userSlice = createSlice({
|
|||||||
(restaurant) => restaurant.id === action.payload.id
|
(restaurant) => restaurant.id === action.payload.id
|
||||||
);
|
);
|
||||||
let restaurants: Restaurant[] = state.restaurants || [];
|
let restaurants: Restaurant[] = state.restaurants || [];
|
||||||
|
if (index != undefined) {
|
||||||
state = {
|
state = {
|
||||||
...state,
|
...state,
|
||||||
restaurants: [
|
restaurants: [
|
||||||
@@ -35,9 +36,12 @@ export const userSlice = createSlice({
|
|||||||
...restaurants.slice(index + 1),
|
...restaurants.slice(index + 1),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
state = state;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { clearUserData } = userSlice.actions;
|
export const { clearUserData, updateRestaurant } = userSlice.actions;
|
||||||
export default userSlice.reducer;
|
export default userSlice.reducer;
|
||||||
|
|||||||
Reference in New Issue
Block a user