import { createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";

export const submitMessage = createAsyncThunk("SUBMIT_MESSAGE", async (d) => {
  try {
    const { data, status } = await axios.post("message/", d);
    return { data, status };
  } catch (e) {
    return { error: e.response.data.result };
  }
});
