tidying db functions

This commit is contained in:
2024-01-31 12:01:20 +01:00
parent 7b1bef3695
commit f2dd0e51e2
5 changed files with 62 additions and 47 deletions

View File

@ -24,7 +24,6 @@ async function fetch_history() {
const response = await fetch(`${currentUrl}app/datahistory`);
const rawData = await response.json();
var dateFormat = d3.timeParse("%a, %d %b %Y %H:%M:%S GMT");
console.log(rawData)
// SELECT uuid, quantity, discount_percentage, price, currency, h_timestamp
let historyData = rawData.map(d => ({
uuid: d[0],
@ -32,7 +31,6 @@ async function fetch_history() {
currency: d[4],
date: dateFormat(d[5]),
}));
console.log(historyData)
return historyData;
} catch (error) {
console.error('Error fetching data history: ', error);