รายการเงินเดือน => ปรับ async/await

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-05 10:57:08 +07:00
parent c9b4238c97
commit 8ce321943f

View file

@ -139,9 +139,9 @@ function getSnap(code: string) {
* function เรยกขอมลหนยวงาน
* @param id revisionId
*/
function getAgency(id: string) {
async function getAgency(id: string) {
id &&
http
(await http
.get(config.API.activeOrganizationRootById(id))
.then(async (res) => {
const data = res.data.result;
@ -153,7 +153,7 @@ function getAgency(id: string) {
})
.catch((err) => {
messageError($q, err);
});
}));
}
/**
@ -162,7 +162,7 @@ function getAgency(id: string) {
*/
async function getAgencyPosition(id: string) {
if (id) {
http
await http
.get(config.API.keycloakPositionByid(id))
.then(async (res) => {
const data = res.data.result;
@ -170,7 +170,7 @@ async function getAgencyPosition(id: string) {
const position = agencyOptions.value?.find(
(e: DataOption) => e.id === data.rootId
);
agencyFilter.value = await (position ? position.id : "");
agencyFilter.value = position ? position.id : "";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(