From 66372f67a21e4e286f10b33d1b7d99d1ec240e27 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 2 Aug 2024 17:55:01 +0200 Subject: [PATCH] clean code --- src/routes/crypto/[tickerID]/+layout.server.ts | 6 +++--- src/routes/stocks/[tickerID]/+layout.server.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/routes/crypto/[tickerID]/+layout.server.ts b/src/routes/crypto/[tickerID]/+layout.server.ts index 630f20d4..d83545a0 100644 --- a/src/routes/crypto/[tickerID]/+layout.server.ts +++ b/src/routes/crypto/[tickerID]/+layout.server.ts @@ -42,6 +42,7 @@ const fetchWatchlist = async (fastifyURL, userId) => { return output; } +/* async function fetchPortfolio(fastifyURL, userId) { const postData = {'userId': userId}; @@ -58,6 +59,7 @@ async function fetchPortfolio(fastifyURL, userId) return output } +*/ export const load = async ({ params, locals, setHeaders}) => { @@ -71,7 +73,7 @@ export const load = async ({ params, locals, setHeaders}) => { fetchData(apiURL,apiKey,'/stock-quote',params.tickerID), fetchData(apiURL,apiKey,'/one-day-price',params.tickerID), fetchWatchlist(fastifyURL, locals?.user?.id), - fetchPortfolio(fastifyURL, locals?.user?.id) + //fetchPortfolio(fastifyURL, locals?.user?.id) ]; const [ @@ -79,7 +81,6 @@ export const load = async ({ params, locals, setHeaders}) => { getStockQuote, getOneDayPrice, getUserWatchlist, - getUserPortfolio, ] = await Promise.all(promises); @@ -93,7 +94,6 @@ export const load = async ({ params, locals, setHeaders}) => { getStockQuote, getOneDayPrice, getUserWatchlist, - getUserPortfolio, companyName, }; diff --git a/src/routes/stocks/[tickerID]/+layout.server.ts b/src/routes/stocks/[tickerID]/+layout.server.ts index 6d290eb9..9b361fd2 100644 --- a/src/routes/stocks/[tickerID]/+layout.server.ts +++ b/src/routes/stocks/[tickerID]/+layout.server.ts @@ -64,7 +64,7 @@ export const load = async ({ params, locals, cookies, setHeaders }) => { const [ getSimilarStock, getStockDeck, getAnalystRating, getStockQuote, getBullBearSay, getWhyPriceMoved, getTopETFHolder, getOneDayPrice, - getUserWatchlist, getUserPortfolio, getCommunitySentiment + getUserWatchlist, getCommunitySentiment ] = await Promise.all(promises); setHeaders({ 'cache-control': 'public, max-age=300' }); @@ -79,7 +79,6 @@ export const load = async ({ params, locals, cookies, setHeaders }) => { getTopETFHolder, getOneDayPrice, getUserWatchlist, - getUserPortfolio, getCommunitySentiment, companyName: cleanString(getStockDeck?.[0]?.companyName), };