import { defineStore } from "pinia";
import { request } from "../api";

export const useFeedBackStore = defineStore({
  id: "feedback",
  state: () => {
    return {};
  },
  getters: {},
  actions: {
    async sendFeedback(param) {
      const { data } = await request.post("/show/message/save", param);
      const { msg, data: result, code } = data;
      if (code === 0) {
        return Promise.resolve({
          isOK: true,
        });
      } else {
        return Promise.resolve({
          isOK: false,
          msg,
        });
      }
    },
  },
});
