Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/api/coachProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const extractCoachProfile = (payload: unknown): CoachProfileRecord | undefined =
return payload as CoachProfileRecord;
};

export const fetchCoachProfile = async (coachId: number, options?: FetchCoachProfileOptions) => {
if (!coachId) {
export const fetchCoachProfile = async (coachId: number | string, options?: FetchCoachProfileOptions) => {
const id = String(coachId ?? "").trim();
if (!id) {
throw new Error("Coach ID is required to load the profile.");
}

Expand All @@ -56,7 +57,7 @@ export const fetchCoachProfile = async (coachId: number, options?: FetchCoachPro

const query = params.toString();
const response = await apiRequest(
`/player/coach/profile/${coachId}${query ? `?${query}` : ""}`,
`/player/coach/profile/${id}${query ? `?${query}` : ""}`,
{
method: "GET",
signal: options?.signal,
Expand Down
Loading