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[]) {
|
function insertAvatar(items: DataPerson[]) {
|
||||||
items.map((x: any, index: number) => {
|
items.map((x: any, index: number) => {
|
||||||
http
|
if (x.avatarName != null) {
|
||||||
.get(
|
http
|
||||||
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName)
|
.get(
|
||||||
)
|
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", x.id, x.avatarName)
|
||||||
.then((img) => {
|
)
|
||||||
dataPersonMain.value[index] = {
|
.then((img) => {
|
||||||
...x,
|
dataPersonMain.value[index] = {
|
||||||
avatar: img.data.downloadUrl,
|
...x,
|
||||||
};
|
avatar: img.data.downloadUrl,
|
||||||
})
|
};
|
||||||
.catch(() => {
|
})
|
||||||
dataPersonMain.value[index] = {
|
.catch(() => {
|
||||||
...x,
|
dataPersonMain.value[index] = {
|
||||||
avatar: avatar,
|
...x,
|
||||||
};
|
avatar: avatar,
|
||||||
});
|
};
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
dataPersonMain.value[index] = {
|
||||||
|
...x,
|
||||||
|
avatar: avatar,
|
||||||
|
};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// const convertImageProfile = (id: string) => {
|
// const convertImageProfile = (id: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue