wires up the feedback event handler with redux storie

This commit is contained in:
ajaythapliyal
2023-03-06 23:02:15 +05:30
parent 07e51dc8c6
commit a888f38afb
3 changed files with 37 additions and 19 deletions

View File

@@ -30,6 +30,16 @@ export const conversationSlice = createSlice({
addQuery(state, action: PayloadAction<Query>) {
state.queries.push(action.payload);
},
updateQuery(
state,
action: PayloadAction<{ index: number; query: Partial<Query> }>,
) {
const index = action.payload.index;
state.queries[index] = {
...state.queries[index],
...action.payload.query,
};
},
},
extraReducers(builder) {
builder
@@ -55,5 +65,5 @@ export const selectQueries = (state: RootState) => state.conversation.queries;
export const selectStatus = (state: RootState) => state.conversation.status;
export const { addQuery } = conversationSlice.actions;
export const { addQuery, updateQuery } = conversationSlice.actions;
export default conversationSlice.reducer;