This commit is contained in:
Warunee Tamkoo 2024-12-23 15:01:32 +07:00
parent dbf6fe0123
commit 97b07f9e38

View file

@ -2,7 +2,7 @@ import { ref } from "vue";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { useCounterMixin } from "./mixin"; import { useCounterMixin } from "./mixin";
const { messageError, success,hideLoader } = useCounterMixin(); const { messageError, success, hideLoader } = useCounterMixin();
export const useLinkageStore = defineStore("linkageData", () => { export const useLinkageStore = defineStore("linkageData", () => {
const apiURL = ref<string>("http://127.0.0.1:51548"); // API URL From Agent const apiURL = ref<string>("http://127.0.0.1:51548"); // API URL From Agent
@ -89,7 +89,16 @@ export const useLinkageStore = defineStore("linkageData", () => {
fetch(`${apiURL.value}/smart-card/read/`, { fetch(`${apiURL.value}/smart-card/read/`, {
method: "POST", method: "POST",
body: JSON.stringify({ body: JSON.stringify({
fields: ["personalID", "engName", "expireDate"], fields: [
"personalID",
"thaiName",
"engName",
"dateOfBirth",
"addressOnCard",
"faceImage",
"issueDate",
"expireDate",
],
}), }),
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -277,7 +286,7 @@ export const useLinkageStore = defineStore("linkageData", () => {
}) })
.catch(async (error) => { .catch(async (error) => {
messageError(q, error); messageError(q, error);
hideLoader() hideLoader();
}); });
} }