fixing bug get profile check avatar value
This commit is contained in:
parent
0de1e4d525
commit
f06f0da910
1 changed files with 23 additions and 16 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue