Skip to content

Commit

Permalink
BugFix - clear the corresponsing state attribute when request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilola-Nazarova committed May 20, 2024
1 parent 5888ebb commit bb69e9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/redux/users/usersSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const usersSlice = createSlice({
.addCase(getUsers.rejected, (state, action) => {
state.isLoading = false;
state.error = action.payload;
state.user = null;
state.value = null;
})
.addCase(getUser.pending, (state) => {
state.isLoading = true;
Expand All @@ -100,7 +100,7 @@ export const usersSlice = createSlice({
.addCase(getUser.rejected, (state, action) => {
state.isLoading = false;
state.error = action.payload;
state.value = null;
state.user = null;
})
.addCase(postUser.pending, (state) => {
state.isLoading = true;
Expand Down

0 comments on commit bb69e9a

Please sign in to comment.