diff --git a/src/routes/pricing/+page.svelte b/src/routes/pricing/+page.svelte index ab37db1d..faab05d2 100644 --- a/src/routes/pricing/+page.svelte +++ b/src/routes/pricing/+page.svelte @@ -505,6 +505,7 @@ async function purchasePlan(subscriptionType:string='') { + @@ -526,7 +528,7 @@ async function purchasePlan(subscriptionType:string='') { - + @@ -629,7 +631,7 @@ async function purchasePlan(subscriptionType:string='') { {#if data?.user?.tier !== 'Pro'}
- + {#if data?.user?.tier === 'Pro'} + {/if} - + {:else}
@@ -344,4 +345,3 @@ changeTab(0) - diff --git a/src/routes/stocks/[tickerID]/forecast/analyst/+page.ts b/src/routes/stocks/[tickerID]/forecast/analyst/+page.ts index 095a324c..ad22faa2 100644 --- a/src/routes/stocks/[tickerID]/forecast/analyst/+page.ts +++ b/src/routes/stocks/[tickerID]/forecast/analyst/+page.ts @@ -1,36 +1,32 @@ -import { getCache, setCache } from '$lib/store'; - +import { getCache, setCache } from "$lib/store"; export const load = async ({ parent, params }) => { - const getAnalystTickerHistory = async () => { - let output; - const cachedData = getCache(params.tickerID, 'getAnalystTickerHistory'); - if (cachedData) { - output = cachedData; - } else { + const cachedData = getCache(params.tickerID, "getAnalystTickerHistory"); + if (cachedData) { + output = cachedData; + } else { + const { apiURL, apiKey } = await parent(); - const {apiURL, apiKey} = await parent(); - - const postData = { - ticker: params.tickerID - }; + const postData = { + ticker: params.tickerID, + }; // make the POST request to the endpoint - const response = await fetch(apiURL + '/analyst-ticker-history', { - method: 'POST', + const response = await fetch(apiURL + "/analyst-ticker-history", { + method: "POST", headers: { - "Content-Type": "application/json", "X-API-KEY": apiKey + "Content-Type": "application/json", + "X-API-KEY": apiKey, }, - body: JSON.stringify(postData) + body: JSON.stringify(postData), }); - output = await response.json(); + output = await response.json(); - setCache(params.tickerID, output, 'getAnalystTickerHistory'); - + setCache(params.tickerID, output, "getAnalystTickerHistory"); } return output; @@ -38,6 +34,6 @@ export const load = async ({ parent, params }) => { // Make sure to return a promise return { - getAnalystTickerHistory: await getAnalystTickerHistory() + getAnalystTickerHistory: await getAnalystTickerHistory(), }; };