import { messagesGetSenderMessages } from "../../../features/messages/services/messages-get-sender-messages";
import { messagesGetReciverMessages } from "../../../features/messages/services/messages-get-reciver-messages";

export const messageExtraReducers = {
  [messagesGetSenderMessages.fulfilled]: (state, { payload }) => {
    state.senderMessages = payload.data;
    state.pending = false;
  },
  [messagesGetSenderMessages.pending]: (state) => {
    state.pending = true;
  },
  [messagesGetReciverMessages.fulfilled]: (state, { payload }) => {
    state.reciverMessages = payload.data;
    state.pending = false;
  },
  [messagesGetReciverMessages.pending]: (state) => {
    state.pending = true;
  },
};
