bugfixing: add historical data back
This commit is contained in:
parent
1d3fd92bf2
commit
6db97c89a0
@ -117,6 +117,7 @@ const handleMessage = async (event) => {
|
|||||||
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
silent: true,
|
||||||
grid: {
|
grid: {
|
||||||
left: '0%',
|
left: '0%',
|
||||||
right: '0%',
|
right: '0%',
|
||||||
|
|||||||
@ -125,7 +125,7 @@ export const load = async ({ params }) => {
|
|||||||
async function historicalPrice() {
|
async function historicalPrice() {
|
||||||
let output;
|
let output;
|
||||||
|
|
||||||
const cachedData = getCache(params.tickerID, 'historicalPrice'+'max');
|
const cachedData = getCache(params.tickerID, 'historicalPrice'+'insider');
|
||||||
if (cachedData) {
|
if (cachedData) {
|
||||||
output = cachedData;
|
output = cachedData;
|
||||||
} else {
|
} else {
|
||||||
@ -144,8 +144,10 @@ async function historicalPrice() {
|
|||||||
|
|
||||||
output = await response?.json() ?? [];
|
output = await response?.json() ?? [];
|
||||||
|
|
||||||
/*
|
//Adding this would create a bug hence I cant use the historicalPrice endpoint such as in +page.svelte but rather need to call
|
||||||
const mapData = (data) => data?.map(({ time, open, high, low, close }) => ({
|
// it again without modification.
|
||||||
|
/*
|
||||||
|
output= (data) => data?.map(({ time, open, high, low, close }) => ({
|
||||||
time: Date.parse(time),
|
time: Date.parse(time),
|
||||||
open,
|
open,
|
||||||
high,
|
high,
|
||||||
@ -154,7 +156,8 @@ async function historicalPrice() {
|
|||||||
}));
|
}));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setCache(params.tickerID, output, 'historicalPrice'+'max');
|
|
||||||
|
setCache(params.tickerID, output, 'historicalPrice'+'insider');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user