import {defineStore} from "pinia";
import {apiGet} from "@/utils/http.js";

export const useLogsStore = defineStore('logs', {
  state: () => ({
    logs: [],
    loading: false,
  }),

  actions: {
    async fetchLogsFromServer() {
      this.loading = true;
      try {
        const response = await apiGet('getLogs');
        this.logs = response.data || [];
      } finally {
        this.loading = false;
      }
    },
  },
});
