completionId: cgen-8615ea720f914b8fb788e25f8e82195b
cgen-8615ea720f914b8fb788e25f8e82195b
This commit is contained in:
parent
6207b2b9a2
commit
80bfbea1c6
1 changed files with 4 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ export interface CreatorsResponse {
|
|||
};
|
||||
}
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
const getApiBase = () => typeof window !== "undefined" ? window.location.origin : "";
|
||||
|
||||
export async function getCreators(filters?: {
|
||||
arm?: string;
|
||||
|
|
@ -168,8 +168,10 @@ export async function endorseSkill(
|
|||
creatorId: string,
|
||||
skill: string,
|
||||
): Promise<void> {
|
||||
const apiBase = getApiBase();
|
||||
if (!apiBase) throw new Error("No API base available");
|
||||
const response = await fetch(
|
||||
`${API_BASE}/api/creators/${creatorId}/endorse`,
|
||||
`${apiBase}/api/creators/${creatorId}/endorse`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
|
|||
Loading…
Reference in a new issue