frontend/src/routes/list/highest-option-premium/+page.server.ts
2025-01-06 12:49:08 +01:00

25 lines
567 B
TypeScript

export const load = async ({ locals }) => {
const getStocks = async () => {
const { apiKey, apiURL } = locals;
const postData = { filterList: 'highest-option-premium' };
const response = await fetch(apiURL + "/list-category", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
body: JSON.stringify(postData),
});
const output = await response.json();
return output;
};
// Make sure to return a promise
return {
getStocks: await getStocks(),
};
};