fix fetch

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-24 11:39:09 +07:00
parent 1888ce2f8b
commit 6824988322
9 changed files with 111 additions and 61 deletions

View file

@ -16,6 +16,7 @@ export const useDataStore = defineStore("dataMain", () => {
const { messageError, showLoader, hideLoader, findPosMasterNo, findOrgName } =
mixin;
// ref() คือการประกาศ state เหมือน vuex
const profileId = ref<string>("");
const formData = reactive<ProfileData>({
profileId: "",
rank: "",
@ -101,6 +102,7 @@ export const useDataStore = defineStore("dataMain", () => {
async function getData(dataPerson: any) {
const data = await dataPerson;
profileId.value = data.profileId;
isProbation.value = data.isProbation;
formData.profileId = data.profileId;
formData.rank = data.rank;
@ -166,6 +168,7 @@ export const useDataStore = defineStore("dataMain", () => {
officerLink,
getProFileType,
dataProfile,
profileId,
};
});