frontend/src/routes/watchlist/stocks/+page.server.ts
2024-11-11 11:35:36 +01:00

25 lines
494 B
TypeScript

export const load = async ({ locals }) => {
const getAllWatchlist = async () => {
const { pb, user } = locals;
try {
const output = await pb.collection("watchlist").getFullList({
filter: `user="${user?.id}"`,
sort: "-updated",
});
return output;
} catch (e) {
return [];
}
};
// Make sure to return a promise
return {
//getMiniPlotsIndex: await getMiniPlotsIndex(),
getAllWatchlist: await getAllWatchlist(),
};
};