Funkční generování QR kódů

This commit is contained in:
mates committed 2023-06-17 09:32:41 +02:00
1 parent 45c2f9e264
commit 55b9d1681e
9 files changed
+174 -24

No files matched your search

+2 -4
View File
@@ -3,6 +3,7 @@ import os from 'os';
import path from 'path';
import fs from 'fs';
import axios from 'axios';
import { formatDate } from './utils';
type PizzaSize = {
varId: number,
@@ -85,10 +86,7 @@ const downloadPizzy = async () => {
export const fetchPizzy = async (): Promise<Pizza[]> => {
const tmpDir = os.tmpdir();
const date_ob = new Date();
const date = ("0" + date_ob.getDate()).slice(-2);
const month = ("0" + (date_ob.getMonth() + 1)).slice(-2);
const year = date_ob.getFullYear();
const dateStr = year + "-" + month + "-" + date;
const dateStr = formatDate(date_ob);
const dataPath = path.join(tmpDir, `chefie-${dateStr}.json`);
if (fs.existsSync(dataPath)) {