CardProfile => CheckAvatar
This commit is contained in:
parent
b53eaa8fea
commit
d2edb44540
2 changed files with 19 additions and 9 deletions
|
|
@ -38,7 +38,7 @@ const profileId = ref<string | null>("");
|
|||
|
||||
function fetchDataProfile(data: DataProfile) {
|
||||
if (data.profileId) {
|
||||
fetchProfile(data.profileId);
|
||||
fetchCheckAvatar(data.profileId);
|
||||
}
|
||||
profile.id = data.profileId;
|
||||
profile.fullName = `${data.prefix ?? ""}${data.firstName ?? ""} ${
|
||||
|
|
@ -72,12 +72,19 @@ function fetchDataProfile(data: DataProfile) {
|
|||
}
|
||||
}
|
||||
|
||||
function fetchProfile(id: string) {
|
||||
function fetchCheckAvatar(id: string) {
|
||||
http.get(config.API.orgCheckAvatar(id)).then((res) => {
|
||||
const data = res.data.result;
|
||||
if (data.avatarName) {
|
||||
fetchProfile(id, data.avatarName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function fetchProfile(id: string, name: string) {
|
||||
if (profile.avatar === "") {
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
|
||||
)
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`))
|
||||
.then(async (res) => {
|
||||
profile.avatar = res.data.downloadUrl;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue