Funkční generování QR kódů
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user