remove portfoliio endpoint

This commit is contained in:
MuslemRahimi 2024-08-02 17:36:57 +02:00
parent 383d8e93a5
commit 3576827c1b
2 changed files with 3 additions and 6 deletions

View File

@ -31,7 +31,7 @@ const fetchFromFastify = async (fastifyURL, endpoint, userId) => {
};
export const load = async ({ params, locals, setHeaders }) => {
const { apiURL, fastifyURL, apiKey, wsURL, user } = locals;
const { apiURL, fastifyURL, apiKey, user } = locals;
const { tickerID } = params;
const endpoints = [
@ -42,7 +42,7 @@ export const load = async ({ params, locals, setHeaders }) => {
const promises = [
...endpoints.map(endpoint => fetchData(apiURL, apiKey, endpoint, tickerID)),
fetchFromFastify(fastifyURL, '/all-watchlists', user?.id),
fetchFromFastify(fastifyURL, '/get-portfolio-data', user?.id)
//fetchFromFastify(fastifyURL, '/get-portfolio-data', user?.id)
];
const [
@ -55,7 +55,6 @@ export const load = async ({ params, locals, setHeaders }) => {
getWhyPriceMoved,
getOneDayPrice,
getUserWatchlist,
getUserPortfolio,
] = await Promise.all(promises);
setHeaders({ 'cache-control': 'public, max-age=300' });
@ -70,8 +69,6 @@ export const load = async ({ params, locals, setHeaders }) => {
getWhyPriceMoved,
getOneDayPrice,
getUserWatchlist,
getUserPortfolio,
companyName: cleanString(getETFProfile?.[0]?.name),
wsURL,
};
};

View File

@ -57,7 +57,7 @@ export const load = async ({ params, locals, cookies, setHeaders }) => {
const promises = [
...endpoints.map(endpoint => fetchData(apiURL, apiKey, endpoint, tickerID)),
fetchFromFastify(fastifyURL, '/all-watchlists', user?.id),
fetchFromFastify(fastifyURL, '/get-portfolio-data', user?.id),
//fetchFromFastify(fastifyURL, '/get-portfolio-data', user?.id),
fetchCommunitySentiment(pb, tickerID, cookies)
];