// redux/thunks/getMessagesThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { fetchMessagesService } from "@/services/fetchMessagesService";

export const getMessagesThunk = createAsyncThunk(
  "messages/getAll",
  async ({ fromDate, toDate }: { fromDate: string; toDate: string }) => {
    return await fetchMessagesService(fromDate, toDate);
  }
);
