frontend/src/routes/insider-tracker/+page.server.ts
MuslemRahimi 1e6e90d616 ui fix
2025-03-31 01:16:37 +02:00

24 lines
540 B
TypeScript

export const load = async ({ locals }) => {
const getInsiderTracker = async () => {
const { apiKey, apiURL, user } = locals;
// make the POST request to the endpoint
const response = await fetch(apiURL + "/insider-tracker", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
});
let output = await response.json();
return output;
};
// Make sure to return a promise
return {
getInsiderTracker: await getInsiderTracker(),
};
};