import { defineStore } from "pinia";
import ajax from "@/plugins/ajax.js";

export const useUiStore = defineStore("UiStore", {
  state: () => ({
    loading: false,
    httpLogs: window.gcargo.http_logs || "",
    cargoCompanies: window.gcargo.cargo_companies || [],
    allOrderStatuses: window.gcargo.all_order_statuses || [],
  }),
  actions: {
    clearLogs: async () => {
      await ajax.post("clear_http_logs");
    },
    dropDB: async () => {
      await ajax.post("drop_database");
    },
  },
});
