From c1386f00153efe06d072edd03c7388c33beba5a2 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 5 Sep 2024 23:35:46 +0200 Subject: [PATCH] bugfixing --- src/lib/utils.ts | 2 +- src/routes/list/uk-stocks-us/+page.ts | 28 +++++++++---------- .../stock-screener/[strategyId]/+page.svelte | 16 ++++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 8c3094a3..a2383b2f 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -997,7 +997,7 @@ export const listOfRelevantCountries = [ "United States", // By far the most companies listed on the NYSE "China", "Canada", - "UK", + "United Kingdom", "Japan", "Israel", "Brazil", diff --git a/src/routes/list/uk-stocks-us/+page.ts b/src/routes/list/uk-stocks-us/+page.ts index c5c04a84..75896669 100644 --- a/src/routes/list/uk-stocks-us/+page.ts +++ b/src/routes/list/uk-stocks-us/+page.ts @@ -1,32 +1,30 @@ -import { getCache, setCache } from '$lib/store'; +import { getCache, setCache } from "$lib/store"; - - -export const load = async ({parent}) => { +export const load = async ({ parent }) => { const getUKStocksUS = async () => { let output; // Get cached data for the specific tickerID - const cachedData = getCache('', 'getUKStocksUS'); + const cachedData = getCache("", "getUKStocksUS"); if (cachedData) { output = cachedData; } else { - - const{ apiURL, apiKey} = await parent(); - - const postData = {'filterList': 'UK'} + const { apiURL, apiKey } = await parent(); - const response = await fetch(apiURL + '/filter-stock-list', { - method: 'POST', + const postData = { filterList: "GB" }; + + const response = await fetch(apiURL + "/filter-stock-list", { + method: "POST", headers: { - "Content-Type": "application/json", "X-API-KEY": apiKey + "Content-Type": "application/json", + "X-API-KEY": apiKey, }, body: JSON.stringify(postData), }); output = await response.json(); - setCache('', output, 'getUKStocksUS'); + setCache("", output, "getUKStocksUS"); } return output; @@ -34,6 +32,6 @@ export const load = async ({parent}) => { // Make sure to return a promise return { - getUKStocksUS: await getUKStocksUS() + getUKStocksUS: await getUKStocksUS(), }; -}; \ No newline at end of file +}; diff --git a/src/routes/stock-screener/[strategyId]/+page.svelte b/src/routes/stock-screener/[strategyId]/+page.svelte index 07cb90c4..d5a0844c 100644 --- a/src/routes/stock-screener/[strategyId]/+page.svelte +++ b/src/routes/stock-screener/[strategyId]/+page.svelte @@ -824,19 +824,18 @@ function handleInput(event) { {:else} - {/if} - + {#if row?.rule !== 'country'} {#each row?.step as newValue} @@ -850,9 +849,12 @@ function handleInput(event) { {:else} {#each (testList.length > 0 && searchQuery?.length > 0 ? testList : searchQuery?.length > 0 && testList?.length === 0 ? [] : listOfRelevantCountries) as item} - +
+ +
{/each}