From 542b3667c1a50019831795f199292673f9ce9364 Mon Sep 17 00:00:00 2001 From: sahilkashyap64 Date: Tue, 12 May 2026 01:12:57 +0530 Subject: [PATCH] fix: use presigned avatar upload flow for profile photos and scroll to packages fixed --- src/api/player.ts | 7 ++----- src/pages/CoachProfilePage.tsx | 18 +++++++++++++++--- src/services/avatar.js | 7 ++----- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/api/player.ts b/src/api/player.ts index 2748acf3..92621ffb 100644 --- a/src/api/player.ts +++ b/src/api/player.ts @@ -97,12 +97,9 @@ export const updatePlayerLesson = async ({ }); export const getPlayerAWSUrl = async (token: string, fileType: string) => - request("/player/profile_picture/upload_url", { - method: "POST", + request(`/player/avatars?file_type=${encodeURIComponent(fileType)}`, { + method: "GET", token, - body: { - file_extension: fileType, - }, }); const toBlob = async (input: string | Blob | ArrayBuffer | ArrayBufferView) => { diff --git a/src/pages/CoachProfilePage.tsx b/src/pages/CoachProfilePage.tsx index 4b9d9eaa..6ee7e7f2 100644 --- a/src/pages/CoachProfilePage.tsx +++ b/src/pages/CoachProfilePage.tsx @@ -886,7 +886,8 @@ const CoachProfilePage = () => { const aboutRef = useRef(null); const specialtiesRef = useRef(null); const courtsRef = useRef(null); - const packagesRef = useRef(null); + const desktopPackagesRef = useRef(null); + const mobilePackagesRef = useRef(null); const desktopBookingRef = useRef(null); const mobileBookingRef = useRef(null); const bioRef = useRef(null); @@ -2490,7 +2491,18 @@ const CoachProfilePage = () => { - @@ -2835,7 +2847,7 @@ const CoachProfilePage = () => { ) : null}
{packagesLoading ?
Loading packages…
: null} diff --git a/src/services/avatar.js b/src/services/avatar.js index 23ae1c97..4f3919c1 100644 --- a/src/services/avatar.js +++ b/src/services/avatar.js @@ -26,13 +26,10 @@ export const getPlayerAWSUrl = async (token, extension = "jpeg") => { } const response = await unwrap( - api(`/player/profile_picture/upload_url`, { - method: "POST", + api(`/player/avatars?file_type=${encodeURIComponent(extension)}`, { + method: "GET", authToken: authHeader, authSchemePreference: "token", - json: { - file_extension: extension, - }, }), );