refactor: comment fetchKeycloakPosition existingData
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m14s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m14s
This commit is contained in:
parent
659e369663
commit
ae846c9bb8
1 changed files with 21 additions and 20 deletions
|
|
@ -178,31 +178,32 @@ const landingPageUrl = ref<string>(configParam.landingPageUrl)
|
|||
/** ฟังก์ชันเรียกข้อมูลผู้ใช่งาน*/
|
||||
async function fetchKeycloakPosition() {
|
||||
// เช็คว่ามีข้อมูลใน store อยู่แล้วหรือไม่ (จาก localStorage)
|
||||
const existingData = positionKeycloakStore.dataPositionKeycloak
|
||||
// จะช่วยลดจำนวนครั้งในการเรียก API และปรับปรุงประสิทธิภาพของแอปพลิเคชัน
|
||||
// const existingData = positionKeycloakStore.dataPositionKeycloak
|
||||
|
||||
if (existingData) {
|
||||
// มีข้อมูลอยู่แล้ว ใช้ข้อมูลเดิม
|
||||
// if (existingData) {
|
||||
// // มีข้อมูลอยู่แล้ว ใช้ข้อมูลเดิม
|
||||
|
||||
// เช็คว่ามีข้อมูลสังกัด (organization) หรือไม่
|
||||
const hasOrganization =
|
||||
existingData.organization &&
|
||||
(existingData.organization.root ||
|
||||
existingData.organization.child1 ||
|
||||
existingData.organization.child2 ||
|
||||
existingData.organization.child3 ||
|
||||
existingData.organization.child4)
|
||||
// // เช็คว่ามีข้อมูลสังกัด (organization) หรือไม่
|
||||
// const hasOrganization =
|
||||
// existingData.organization &&
|
||||
// (existingData.organization.root ||
|
||||
// existingData.organization.child1 ||
|
||||
// existingData.organization.child2 ||
|
||||
// existingData.organization.child3 ||
|
||||
// existingData.organization.child4)
|
||||
|
||||
if (!hasOrganization) {
|
||||
// ไม่มีข้อมูลสังกัด redirect ไปหน้า NoPosition
|
||||
router.replace('/no-position')
|
||||
return
|
||||
}
|
||||
// if (!hasOrganization) {
|
||||
// // ไม่มีข้อมูลสังกัด redirect ไปหน้า NoPosition
|
||||
// router.replace('/no-position')
|
||||
// return
|
||||
// }
|
||||
|
||||
privacyStore.modalPrivacy = !existingData.privacyCheckin
|
||||
privacyStore.setAccepted(existingData.privacyCheckin)
|
||||
// privacyStore.modalPrivacy = !existingData.privacyCheckin
|
||||
// privacyStore.setAccepted(existingData.privacyCheckin)
|
||||
|
||||
return
|
||||
}
|
||||
// return
|
||||
// }
|
||||
|
||||
// ไม่มีข้อมูล ให้ fetch จาก API
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue