reports.js 402 B

1234567891011121314151617
  1. /* eslint-disable import/no-cycle */
  2. import Toast from "toasters";
  3. import ws from "@/ws";
  4. export default {
  5. resolve(reportId) {
  6. return new Promise((resolve, reject) => {
  7. ws.socket.dispatch("reports.resolve", reportId, res => {
  8. new Toast(res.message);
  9. if (res.status === "success")
  10. return resolve({ status: "success" });
  11. return reject(new Error(res.message));
  12. });
  13. });
  14. }
  15. };