diff --git a/src/lib/components/Options/UnusualActivity.svelte b/src/lib/components/Options/UnusualActivity.svelte index 317a5c99..f12238ee 100644 --- a/src/lib/components/Options/UnusualActivity.svelte +++ b/src/lib/components/Options/UnusualActivity.svelte @@ -1,8 +1,18 @@ @@ -144,6 +351,13 @@ > Unusual Activity + + +
+ +
- {#each displayList as item, index} + {#each data?.user?.tier !== "Pro" ? displayList?.slice(0, 3) : displayList as item, index} {item?.optionType} @@ -182,7 +401,12 @@ {item?.unusualType} diff --git a/src/routes/stocks/[tickerID]/options/unusual-activity/+page.server.ts b/src/routes/stocks/[tickerID]/options/unusual-activity/+page.server.ts index 18e906f5..2125234f 100644 --- a/src/routes/stocks/[tickerID]/options/unusual-activity/+page.server.ts +++ b/src/routes/stocks/[tickerID]/options/unusual-activity/+page.server.ts @@ -18,7 +18,22 @@ export const load = async ({ locals, params }) => { }); let output = await response.json(); - + return output; + }; + + const getHistoricalPrice = async () => { + const postData = { ticker: params.tickerID, timePeriod: "six-months" }; + const response = await fetch(apiURL + "/historical-price", { + method: "POST", + headers: { + "Content-Type": "application/json", + "X-API-KEY": apiKey, + }, + body: JSON.stringify(postData), + }); + + const output = await response.json(); + return output; }; @@ -27,6 +42,7 @@ export const load = async ({ locals, params }) => { // Make sure to return a promise return { getData: await getData(), + getHistoricalPrice: await getHistoricalPrice(), }; };
{item?.sentiment}