diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts index 62d0e9001..60d6650be 100644 --- a/src/api/registry/api.profile.ts +++ b/src/api/registry/api.profile.ts @@ -201,10 +201,13 @@ export default { profileVerified: (profileId: string) => `${profile}verified/${profileId}`, profileVerifiedUnlock: (profileId: string) => `${profile}not-verified/${profileId}`, - profileSendVerified: (profileId: string) => `${profile}send-verified/${profileId}`, + profileSendVerified: (profileId: string) => + `${profile}send-verified/${profileId}`, listVerified: () => `${profile}list-verified`, registryNew, registryNewId: (id: string) => `${registryNew}${id}`, + profileNewCitizenId: (citizenId: string) => + `${registryNew}citizenId/${citizenId}`, /**ปรับรายการเงินเดือนขึ้น-ลง*/ salarySwap: (dierction: string, id: string) => diff --git a/src/modules/04_registryNew/components/registry/registry.vue b/src/modules/04_registryNew/components/registry/registry.vue index e5f797873..0c43cbcc6 100644 --- a/src/modules/04_registryNew/components/registry/registry.vue +++ b/src/modules/04_registryNew/components/registry/registry.vue @@ -292,15 +292,16 @@ async function changeCardID(citizenId: string | number | null) { if (citizenId != null && typeof citizenId == "string") { if (citizenId.length == 13 && citizenId) { await http - .get(config.API.profileCitizenId(citizenId)) - .then((res) => { - console.log(res); - const statusId = res.data.result.citizen; - !statusId && - dialogMessageNotify($q, "เลขประจำตัวประชาชนนี้มีการใช้งานแล้ว"); + .put(config.API.profileNewCitizenId(citizenId), { + citizenId: citizenId, }) + .then(() => {}) .catch((err) => { - messageError($q, err); + if (err.response.data.status === 500) { + dialogMessageNotify($q, err.response.data.message); + } else { + messageError($q, err); + } }); } }