fix: await API fileByFile
This commit is contained in:
parent
7d46985570
commit
176b22e756
6 changed files with 38 additions and 21 deletions
|
|
@ -52,7 +52,7 @@ function fetchInformation() {
|
|||
citizenId.value = data.citizenId;
|
||||
|
||||
if (data.avatarName) {
|
||||
await fetchProfile(data.id as string, data.avatarName);
|
||||
fetchProfile(data.id as string, data.avatarName);
|
||||
} else {
|
||||
avatar.value = avatarMain;
|
||||
}
|
||||
|
|
@ -70,11 +70,14 @@ function fetchInformation() {
|
|||
* @param id profileId
|
||||
* @param avatarName ชื้อไฟล์
|
||||
*/
|
||||
async function fetchProfile(id: string, avatarName: string) {
|
||||
function fetchProfile(id: string, avatarName: string) {
|
||||
http
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
avatar.value = res.data.downloadUrl;
|
||||
})
|
||||
.catch(() => {
|
||||
avatar.value = avatarMain;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue