frontend/src/routes/dark-pool-flow/+page.server.ts
MuslemRahimi 91515ddbc1 ui fix
2025-01-03 16:43:13 +01:00

24 lines
577 B
TypeScript

export const load = async ({ locals }) => {
const { apiURL, apiKey, user } = locals;
const getFlowData = async () => {
// make the POST request to the endpoint
const response = await fetch(apiURL + "/dark-pool-flow-feed", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
});
let output = await response.json();
output = user?.tier !== "Pro" ? output?.slice(0,6) : output;
return output;
};
return {
getFlowData: await getFlowData(),
};
};