diff --git a/src/modules/04_registryNew/views/list.vue b/src/modules/04_registryNew/views/list.vue index 5118a2721..52d51be47 100644 --- a/src/modules/04_registryNew/views/list.vue +++ b/src/modules/04_registryNew/views/list.vue @@ -170,22 +170,29 @@ async function fetchDataPerson(search: boolean = false) { function insertAvatar(items: DataPerson[]) { items.map((x: any, index: number) => { - http - .get( - config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName) - ) - .then((img) => { - dataPersonMain.value[index] = { - ...x, - avatar: img.data.downloadUrl, - }; - }) - .catch(() => { - dataPersonMain.value[index] = { - ...x, - avatar: avatar, - }; - }); + if (x.avatarName != null) { + http + .get( + config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName) + ) + .then((img) => { + dataPersonMain.value[index] = { + ...x, + avatar: img.data.downloadUrl, + }; + }) + .catch(() => { + dataPersonMain.value[index] = { + ...x, + avatar: avatar, + }; + }); + } else { + dataPersonMain.value[index] = { + ...x, + avatar: avatar, + }; + } }); } // const convertImageProfile = (id: string) => {