-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
604cf94
commit 3e4fed3
Showing
8 changed files
with
66 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
export function getBase64(img:File, callback:Function) { | ||
export function getBase64(img: File, callback: Function) { | ||
const reader = new FileReader(); | ||
reader.addEventListener("load", () => callback(reader.result)); | ||
reader.readAsDataURL(img); | ||
} | ||
|
||
|
||
export function getAvatarSrc( | ||
avatarPreview: null | string | undefined , | ||
avatarPreview: null | string | undefined, | ||
userPhoto: string | undefined, | ||
API_URL: string | undefined, | ||
API_URL: string | undefined | ||
): string | undefined { | ||
if (typeof avatarPreview === 'undefined' && typeof userPhoto === 'string' && userPhoto.startsWith('/uploads/')) { | ||
if ( | ||
typeof avatarPreview === "undefined" && | ||
typeof userPhoto === "string" && | ||
userPhoto.startsWith("/uploads/") | ||
) { | ||
const previewUrl = `${API_URL}${userPhoto}`; | ||
console.log('previewUrl', previewUrl); | ||
console.log("previewUrl", previewUrl); | ||
return previewUrl; | ||
} else { | ||
return userPhoto; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,5 +132,3 @@ export async function registerUser(values: any) { | |
|
||
return response.data; | ||
} | ||
|
||
|