fix: await API fileByFile
This commit is contained in:
parent
7d46985570
commit
176b22e756
6 changed files with 38 additions and 21 deletions
|
|
@ -323,10 +323,10 @@ async function uploadFileURL(uploadUrl: string, file: any) {
|
|||
* ฟังก์ชันดึงข้อมูลรูปโปรไฟล์
|
||||
* @param id โปรไฟล์
|
||||
*/
|
||||
async function fetchProfile(id: string) {
|
||||
await http
|
||||
function fetchProfile(id: string) {
|
||||
http
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
profilePicture.value = res.data.downloadUrl;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
@ -403,7 +403,7 @@ async function fetchDataPersonal() {
|
|||
|
||||
fileName.value = res.data.result.avatarName;
|
||||
if (formDetail.value?.avatarName) {
|
||||
await fetchProfile(profileId.value);
|
||||
fetchProfile(profileId.value);
|
||||
} else {
|
||||
profilePicture.value = avatar;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue