diff --git a/src/api/index.ts b/src/api/index.ts index bf75ba8..e900cfb 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -12,6 +12,7 @@ const config = ref({ development: { // API_URI: "https://localhost:7260/api", API_URI: "https://bma-ehr.frappet.synology.me/api/v1", + API_URL_SUPPORT: "http://192.168.1.10:3000/api/v1/support", MEET_URI: "meet.frappet.com", LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me", }, @@ -21,6 +22,7 @@ const config = ref({ }, production: { API_URI: apiUrlConfig, + API_URL_SUPPORT: "http://192.168.1.10:3000/api/v1/support", API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", @@ -29,6 +31,7 @@ const config = ref({ }); const API_URI = ref(config.value[env.value].API_URI); +const API_URL_SUPPORT = ref(config.value[env.value].API_URL_SUPPORT) const MEET_URI = ref(config.value[env.value].MEET_URI); const LINK_EVALUATE_PUBLISH = ref( config.value[env.value].LINK_EVALUATE_PUBLISH @@ -38,6 +41,7 @@ export default { env: env.value, config: config.value, API_URI: API_URI.value, + API_URL_SUPPORT: API_URL_SUPPORT.value, MEET_URI: MEET_URI.value, LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value, }; diff --git a/src/api/support/api.support.ts b/src/api/support/api.support.ts new file mode 100644 index 0000000..e7308ed --- /dev/null +++ b/src/api/support/api.support.ts @@ -0,0 +1,12 @@ +import env from "../index"; + +const support = `${env.API_URL_SUPPORT}`; + +export default { + supportMessageStatus: (id: string) => `${support}/issue/${id}/message-status`, + supportMessage: (id: string, pageSize: number = 999, page: number = 1) => + `${support}/issue/${id}/message?pageSize=${pageSize}&page=${page}`, + supportIssueUserId: (userId: string) => `${support}/issue?userId=${userId}`, + supportIssue: `${support}/issue`, + supportIssueCategory: `${support}/issue-category`, +}; diff --git a/src/app.config.ts b/src/app.config.ts index e607537..66075b5 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,12 +1,13 @@ /**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */ /** API Metadata */ -import testtest from "./api/test/api.test" -import retirementResign from "./api/leave/api.leave" -import placementTransfer from "./api/transfer/api.transfer" -import appeal from "./api/appeal/api.appeal" -import message from "./api/api.message" +import testtest from "./api/test/api.test"; +import retirementResign from "./api/leave/api.leave"; +import placementTransfer from "./api/transfer/api.transfer"; +import appeal from "./api/appeal/api.appeal"; +import message from "./api/api.message"; import evaluate from "./api/evaluate/api.evaluate"; +import support from "./api/support/api.support"; const API = { ...testtest, @@ -14,7 +15,8 @@ const API = { ...placementTransfer, ...message, ...evaluate, - ...appeal + ...appeal, + ...support, }; export default {