Files
post-hub-platform-k7m2xq9wnp/rag-view/src/features/slices/chat-slice/getChatExtraReducers.js
2026-02-27 20:50:03 +01:00

16 lines
433 B
JavaScript

import fetchGetChat from "../../fetch-async/fetchGetChat";
export const buildGetChatExtraReducers = (builder) => {
builder
.addCase(fetchGetChat.fulfilled, (state, action) => {
const chat = action.payload;
if (chat) {
state.messages = chat.history || [];
}
})
.addCase(fetchGetChat.rejected, (_state, action) => {
console.log("fetchGetChat error:", action.payload?.status);
});
};