ทะเบียนประวัติ ยืนยันตรวจสอบข้อมูลและปลดล็อค

This commit is contained in:
Warunee Tamkoo 2024-02-08 13:52:52 +07:00
parent 6e6e0d2cf9
commit 4e8cff183a
3 changed files with 43 additions and 10 deletions

View file

@ -918,7 +918,21 @@ const roleRegistryverify = ref<boolean>(false);
function onClickVerified() {
dialogConfirm(
$q,
async () => {},
async () => {
showLoader();
await http
.put(config.API.profileVerified(profileId.value))
.then((res) => {
checIsVerified();
success($q, "ยืนยันการตรวจสอบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการตรวจสอบข้อมูล",
"ต้องการยืนยันการตรวจสอบข้อมูลนี้หรือไม่?"
);
@ -927,7 +941,21 @@ function onClickVerified() {
function onClickUnlock() {
dialogConfirm(
$q,
async () => {},
async () => {
showLoader();
await http
.put(config.API.profileVerifiedUnlock(profileId.value))
.then((res) => {
checIsVerified();
success($q, "ปลดล็อคให้แก้ไขข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการปลดให้แก้ไขข้อมูล",
"ต้องการยืนยันการปลดให้แก้ไขข้อมูลนี้หรือไม่?"
);
@ -985,13 +1013,14 @@ async function checIsVerified() {
.then((res) => {
const data = res.data.result;
profileStore.isVerified = data.isVerified
? true
: roleRegistryverify.value
? true
: roleKeyregistry.value
? false
: false;
profileStore.isVerified = data.isVerified;
// profileStore.isVerified = data.isVerified
// ? true
// : roleRegistryverify.value
// ? true
// : roleKeyregistry.value
// ? false
// : false;
})
.catch((err) => {
messageError($q, err);