diff --git a/src/routes/cramer-tracker/+page.ts b/src/routes/cramer-tracker/+page.ts index a797b70d..7d76ed8c 100644 --- a/src/routes/cramer-tracker/+page.ts +++ b/src/routes/cramer-tracker/+page.ts @@ -6,17 +6,18 @@ export const load = async ({parent}) => { const getCramerTracker = async () => { let output; - const data = await parent(); const cachedData = getCache('', 'getCramerTracker'); if (cachedData) { output = cachedData; } else { - // make the POST request to the endpoint - const response = await fetch(data?.apiURL + '/cramer-tracker', { + + const { apiKey, apiURL } = await parent(); + + const response = await fetch(apiURL + '/cramer-tracker', { method: 'GET', headers: { - "Content-Type": "application/json", "X-API-KEY": data?.apiKey + "Content-Type": "application/json", "X-API-KEY": apiKey }, }); diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index b408a286..4a4df93f 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -3,7 +3,6 @@ import { onMount } from 'svelte'; import * as Avatar from "$lib/components/shadcn/avatar/index.js"; - import { Button } from "$lib/components/shadcn/button/index.ts"; import * as Card from "$lib/components/shadcn/card/index.ts"; import * as Table from "$lib/components/shadcn/table/index.ts"; import ArrowUpRight from "lucide-svelte/icons/arrow-up-right"; @@ -19,6 +18,10 @@ const quickInfo = data?.getDashboard?.quickInfo; +function reformatDate(dateString) { + return dateString.substring(5, 7) + '/' + dateString.substring(8) + '/' + dateString.substring(2, 4); +} + function latestInfoDate(inputDate) { // Convert the input date string to milliseconds since epoch const inputDateMs = Date?.parse(inputDate); @@ -219,7 +222,7 @@ onMount( async() => { {item?.put_call} -
+