clean code

This commit is contained in:
MuslemRahimi 2024-08-02 17:55:01 +02:00
parent 3576827c1b
commit 66372f67a2
2 changed files with 4 additions and 5 deletions

View File

@ -42,6 +42,7 @@ const fetchWatchlist = async (fastifyURL, userId) => {
return output; return output;
} }
/*
async function fetchPortfolio(fastifyURL, userId) async function fetchPortfolio(fastifyURL, userId)
{ {
const postData = {'userId': userId}; const postData = {'userId': userId};
@ -58,6 +59,7 @@ async function fetchPortfolio(fastifyURL, userId)
return output return output
} }
*/
export const load = async ({ params, locals, setHeaders}) => { 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,'/stock-quote',params.tickerID),
fetchData(apiURL,apiKey,'/one-day-price',params.tickerID), fetchData(apiURL,apiKey,'/one-day-price',params.tickerID),
fetchWatchlist(fastifyURL, locals?.user?.id), fetchWatchlist(fastifyURL, locals?.user?.id),
fetchPortfolio(fastifyURL, locals?.user?.id) //fetchPortfolio(fastifyURL, locals?.user?.id)
]; ];
const [ const [
@ -79,7 +81,6 @@ export const load = async ({ params, locals, setHeaders}) => {
getStockQuote, getStockQuote,
getOneDayPrice, getOneDayPrice,
getUserWatchlist, getUserWatchlist,
getUserPortfolio,
] = await Promise.all(promises); ] = await Promise.all(promises);
@ -93,7 +94,6 @@ export const load = async ({ params, locals, setHeaders}) => {
getStockQuote, getStockQuote,
getOneDayPrice, getOneDayPrice,
getUserWatchlist, getUserWatchlist,
getUserPortfolio,
companyName, companyName,
}; };

View File

@ -64,7 +64,7 @@ export const load = async ({ params, locals, cookies, setHeaders }) => {
const [ const [
getSimilarStock, getStockDeck, getAnalystRating, getStockQuote, getSimilarStock, getStockDeck, getAnalystRating, getStockQuote,
getBullBearSay, getWhyPriceMoved, getTopETFHolder, getOneDayPrice, getBullBearSay, getWhyPriceMoved, getTopETFHolder, getOneDayPrice,
getUserWatchlist, getUserPortfolio, getCommunitySentiment getUserWatchlist, getCommunitySentiment
] = await Promise.all(promises); ] = await Promise.all(promises);
setHeaders({ 'cache-control': 'public, max-age=300' }); setHeaders({ 'cache-control': 'public, max-age=300' });
@ -79,7 +79,6 @@ export const load = async ({ params, locals, cookies, setHeaders }) => {
getTopETFHolder, getTopETFHolder,
getOneDayPrice, getOneDayPrice,
getUserWatchlist, getUserWatchlist,
getUserPortfolio,
getCommunitySentiment, getCommunitySentiment,
companyName: cleanString(getStockDeck?.[0]?.companyName), companyName: cleanString(getStockDeck?.[0]?.companyName),
}; };