diff --git a/src/modules/00_support/store/Main.ts b/src/modules/00_support/store/Main.ts index 0a7d01cb9..458903d02 100644 --- a/src/modules/00_support/store/Main.ts +++ b/src/modules/00_support/store/Main.ts @@ -12,12 +12,10 @@ import type { SupportMessageStatus, SupportIssueCategoryResponse, } from "@/modules/00_support/interface/index/Main"; -import { useQuasar } from "quasar"; import { getToken, tokenParsed } from "@/plugins/auth"; export const useSupportStore = defineStore("supportServiceStore", async () => { - const { showLoader, hideLoader, messageError } = useCounterMixin(); - const $q = useQuasar(); + const { showLoader, hideLoader } = useCounterMixin(); const userId = ref(""); const issue = ref(); const message = ref(); @@ -123,7 +121,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(config.API.supportMessageStatus(issueId)) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => {}); @@ -136,7 +134,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(`${config.API.supportMessage(currentIssue.value)}?page=${page}`) .catch((err) => { - messageError($q, err); + console.log(err); }); if (res && res.data) { @@ -150,7 +148,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(config.API.supportMessage(issueId)) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -183,7 +181,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .patch(config.API.supportIssueChangeStatus(issueId), requestBody) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -199,7 +197,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(`${config.API.supportIssue}?page=${page}&pageSize=30`) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -217,7 +215,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(config.API.supportSearchIssue(input)) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -237,7 +235,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { name: name, }) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -253,10 +251,10 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .get(config.API.supportCategory) .catch((err) => { - messageError($q, err); + console.log(err); }) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -271,7 +269,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { const res = await http .delete(config.API.supportCategoryAction(CategoryId)) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); @@ -289,7 +287,7 @@ export const useSupportStore = defineStore("supportServiceStore", async () => { name: name, }) .catch((err) => { - messageError($q, err); + console.log(err); }) .finally(() => { hideLoader(); diff --git a/src/modules/04_registryPerson/stores/Address.ts b/src/modules/04_registryPerson/stores/Address.ts index cd106d852..d6ba85b6e 100644 --- a/src/modules/04_registryPerson/stores/Address.ts +++ b/src/modules/04_registryPerson/stores/Address.ts @@ -13,14 +13,8 @@ import type { zipCodeOption, } from "@/modules/04_registryPerson/interface/index/Main"; -const $q = useQuasar(); const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - - messageError, -} = mixin; +const { showLoader, hideLoader } = mixin; export const useAddressDataStore = defineStore("addess", () => { const profileIdBefore = ref(""); @@ -89,7 +83,7 @@ export const useAddressDataStore = defineStore("addess", () => { OpsFilter.value.provinceOps = option; }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { hideLoader(); @@ -122,7 +116,7 @@ export const useAddressDataStore = defineStore("addess", () => { return option; }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { hideLoader(); @@ -158,7 +152,7 @@ export const useAddressDataStore = defineStore("addess", () => { } }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { hideLoader(); diff --git a/src/modules/04_registryPerson/stores/LinkCenter.ts b/src/modules/04_registryPerson/stores/LinkCenter.ts index ccfb5e911..b78d3d3d5 100644 --- a/src/modules/04_registryPerson/stores/LinkCenter.ts +++ b/src/modules/04_registryPerson/stores/LinkCenter.ts @@ -1,13 +1,10 @@ import { ref } from "vue"; import { defineStore } from "pinia"; import { useCounterMixin } from "@/stores/mixin"; -import { useQuasar } from "quasar"; + import http from "@/plugins/http"; import config from "@/app.config"; -import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Address"; -import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Address"; - import type { DataOption, AddressOps, @@ -15,14 +12,8 @@ import type { zipCodeOption, } from "@/modules/04_registryPerson/interface/index/Main"; -const $q = useQuasar(); const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - - messageError, -} = mixin; +const { showLoader, hideLoader } = mixin; export const useDataLinkCenter = defineStore("DataLinkCenter", () => { const retireDate = ref(); @@ -174,10 +165,11 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { OpsPersonFilter.value.religionOps = optionreligions; }) .catch((e) => { - messageError($q, e); - hideLoader(); + console.log(e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } /** -----(จังหวัด-อำเภอ-ตำบล)----- */ @@ -198,7 +190,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { OpsAddressFilter.value.provinceOps = option; }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { isLoad && hideLoader(); @@ -235,7 +227,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { return option; }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { isLoad && hideLoader(); @@ -275,7 +267,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { } }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { isLoad && hideLoader(); @@ -337,22 +329,22 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { } /** - * function fetch ข้อมูลความสัมพันธ์ - */ -function fetchDataRelationship() { - http - .get(config.API.orgRelationship) - .then((res) => { - const list = res.data.result.map((e: any) => ({ - id: e.id, - name: e.name, - })); - optionRelationshipMain.value = list; - }) - .catch((err) => { - messageError($q, err); - }); -} + * function fetch ข้อมูลความสัมพันธ์ + */ + function fetchDataRelationship() { + http + .get(config.API.orgRelationship) + .then((res) => { + const list = res.data.result.map((e: any) => ({ + id: e.id, + name: e.name, + })); + optionRelationshipMain.value = list; + }) + .catch((e) => { + console.log(e); + }); + } return { fetchPerson, OpsPersonFilter, @@ -366,6 +358,6 @@ function fetchDataRelationship() { fetchSubDistrict, optionRelationshipMain, optionRelationship, - fetchDataRelationship + fetchDataRelationship, }; }); diff --git a/src/modules/04_registryPerson/stores/Position.ts b/src/modules/04_registryPerson/stores/Position.ts index ee7c6d0ea..afa88b3c5 100644 --- a/src/modules/04_registryPerson/stores/Position.ts +++ b/src/modules/04_registryPerson/stores/Position.ts @@ -1,15 +1,8 @@ import { ref } from "vue"; import { defineStore } from "pinia"; -import { useQuasar } from "quasar"; - -import { useCounterMixin } from "@/stores/mixin"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; -const $q = useQuasar(); -const mixin = useCounterMixin(); -const {} = mixin; - export const useGovernmentPosDataStore = defineStore("GovernmentPos", () => { // commandCode ขอตำแหน่ง const positionCode = ref([ diff --git a/src/modules/04_registryPerson/stores/profile.ts b/src/modules/04_registryPerson/stores/profile.ts index 22948481d..42c8073b5 100644 --- a/src/modules/04_registryPerson/stores/profile.ts +++ b/src/modules/04_registryPerson/stores/profile.ts @@ -1,6 +1,5 @@ import { ref } from "vue"; import { defineStore } from "pinia"; -import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -12,14 +11,8 @@ import type { InformationOps, } from "@/modules/04_registryPerson/interface/index/Main"; -const $q = useQuasar(); const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - - messageError, -} = mixin; +const { showLoader, hideLoader } = mixin; export const useProfileDataStore = defineStore("profile", () => { const retireDate = ref(); @@ -172,7 +165,7 @@ export const useProfileDataStore = defineStore("profile", () => { OpsFilter.value.religionOps = optionreligions; }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { setTimeout(() => { diff --git a/src/modules/09_leave/stores/ChangeRoundStore.ts b/src/modules/09_leave/stores/ChangeRoundStore.ts index d76e74a4a..e24af76ac 100644 --- a/src/modules/09_leave/stores/ChangeRoundStore.ts +++ b/src/modules/09_leave/stores/ChangeRoundStore.ts @@ -1,5 +1,4 @@ import { defineStore } from "pinia"; -import { useQuasar } from "quasar"; import { ref } from "vue"; import http from "@/plugins/http"; @@ -14,8 +13,8 @@ import type { import type { QTableProps } from "quasar"; const mixin = useCounterMixin(); -const $q = useQuasar(); -const { date2Thai, messageError, showLoader, hideLoader } = mixin; + +const { date2Thai, showLoader, hideLoader } = mixin; const checkCilck = ref(false); const profileId = ref(""); @@ -159,7 +158,7 @@ export const useChangeRoundDataStore = defineStore( } }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { hideLoader(); @@ -208,8 +207,8 @@ export const useChangeRoundDataStore = defineStore( maxPage.value = Math.ceil(total.value / pageSize.value); }); }) - .catch((err) => { - messageError($q, err); + .catch((e) => { + console.log(e); }) .finally(() => { hideLoader(); diff --git a/src/modules/09_leave/stores/SpecialTimeStore.ts b/src/modules/09_leave/stores/SpecialTimeStore.ts index b7f89301d..5cdb002e0 100644 --- a/src/modules/09_leave/stores/SpecialTimeStore.ts +++ b/src/modules/09_leave/stores/SpecialTimeStore.ts @@ -7,11 +7,9 @@ import { useCounterMixin } from "@/stores/mixin"; import type { DataOption } from "@/modules/09_leave/interface/index/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useQuasar } from "quasar"; -const $q = useQuasar(); const mixin = useCounterMixin(); -const { date2Thai, messageError, showLoader, hideLoader } = mixin; +const { date2Thai, showLoader, hideLoader } = mixin; export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => { const rows = ref([]); @@ -93,7 +91,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => { }); }) .catch((e) => { - messageError($q, e); + console.log(e); }) .finally(() => { hideLoader();