Skip to content

Commit

Permalink
feat: add action handlers on other operations
Browse files Browse the repository at this point in the history
  • Loading branch information
philoniare committed Apr 17, 2024
1 parent 15cf5e3 commit 273479f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/features/kittyDetails/index.ts
Expand Up @@ -106,6 +106,27 @@ const kittySlice = createSlice({
}
state.entity = action.payload;
});
builder.addCase(updateKittyPrice.fulfilled, (state, action) => {
if (action.payload.error) {
state.loading = "failed";
return;
}
state.entity = action.payload;
});
builder.addCase(delistKitty.fulfilled, (state, action) => {
if (action.payload.error) {
state.loading = "failed";
return;
}
state.entity = action.payload;
});
builder.addCase(listKitty.fulfilled, (state, action) => {
if (action.payload.error) {
state.loading = "failed";
return;
}
state.entity = action.payload;
});
builder.addCase(getKitty.fulfilled, (state, action) => {
if (action.payload.error) {
state.loading = "failed";
Expand Down

0 comments on commit 273479f

Please sign in to comment.