bugfixing

This commit is contained in:
MuslemRahimi 2025-02-10 13:18:09 +01:00
parent f717fe45a3
commit d800bd9084
3 changed files with 4 additions and 14 deletions

View File

@ -1,6 +1,6 @@
export const load = async ({ locals }) => {
const { apiKey, apiURL} = locals;
const getNews = async () => {
const { apiKey, apiURL } = locals;
const getNews = async () => {
const postData = { newsType: "ipo-news" };
// make the POST request to the endpoint
const response = await fetch(apiURL + "/market-news", {
@ -17,9 +17,7 @@ export const load = async ({ locals }) => {
return output;
};
const getIPOCalendar = async () => {
// make the POST request to the endpoint
const postData = { year: "all" };
@ -34,12 +32,9 @@ export const load = async ({ locals }) => {
const output = await response.json();
return output;
};
// Make sure to return a promise
return {
getNews: await getNews(),

View File

@ -5,6 +5,7 @@
export let data;
let ipoNews = data?.getNews;
console.log(ipoNews);
let rawData = data?.getIPOCalendar?.slice(0, 200) ?? [];
const excludedRules = new Set([
"volume",

View File

@ -1,13 +1,7 @@
<script lang="ts">
import { onMount, onDestroy } from "svelte";
import { goto } from "$app/navigation";
import {
clearCache,
screenWidth,
numberOfUnreadNotification,
getCache,
setCache,
} from "$lib/store";
import { clearCache, screenWidth, getCache, setCache } from "$lib/store";
import toast from "svelte-french-toast";
import {
abbreviateNumber,