api: reconfigered api handling
This commit is contained in:
@@ -20,7 +20,8 @@ export async function getSearchResults(
|
||||
filteredTags.join(",")
|
||||
)}&limit=${limit}`;
|
||||
|
||||
const res = await fetch(url, { signal });
|
||||
const apiKey = process.env.EXPO_PUBLIC_API_KEY;
|
||||
const res = await fetch(url, { signal, headers: { 'Content-Type': 'application/json', "X-API-Key": apiKey ?? "", } });
|
||||
if (!res.ok) throw new Error("AutoComplete failed " + res.status);
|
||||
|
||||
const data: unknown = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user