import { defineStore } from "pinia";

import http from "@/plugins/http";
import config from "@/app.config";

export const useRegistryDataStore = defineStore("RegistryDataStoreMain", () => {
  async function getPathUploadFlie(
    group: string,
    profileId: string,
    id: string
  ) {
    try {
      const res = await http.get(
        config.API.subFileByFileName(
          "ทะเบียนประวัติ",
          group,
          profileId,
          id,
          "เอกสารหลักฐาน"
        )
      );
      return res.data;
    } catch (err) {
      console.log(err);
    }
  }

  return {
    // Function
    getPathUploadFlie,
  };
});
