mirror of
https://github.com/Matewoo/pdf-writer.git
synced 2026-11-18 18:32:44 +01:00
small changes
This commit is contained in:
+5
-5
@@ -208,16 +208,16 @@ app.get('/load-day-daily', (req, res) => {
|
||||
const { exec } = require('child_process');
|
||||
|
||||
app.post('/generate-pdf', (req, res) => {
|
||||
const { week, type } = req.body;
|
||||
const { val, type } = req.body;
|
||||
let pdfPath;
|
||||
console.log('Type:', type);
|
||||
console.log('Week:', week);
|
||||
console.log('Val:', val);
|
||||
|
||||
if (type === 'week') {
|
||||
console.log('Generating PDF for week:', week);
|
||||
pdfPath = `python.exe .\\scripts\\writePdf.py ${week}`;
|
||||
console.log('Generating PDF for week:', val);
|
||||
pdfPath = `python.exe .\\scripts\\writePdf.py ${val}`;
|
||||
} else {
|
||||
console.log('Generating PDF for daily:', week);
|
||||
console.log('Generating PDF for daily:', val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -227,14 +227,14 @@ function loadWeekData(week) {
|
||||
function generatePDF(type) {
|
||||
const weekNumber = getWeekNumber(currentWeek);
|
||||
const year = currentWeek.getFullYear();
|
||||
const week = `KW${weekNumber}-${year}`;
|
||||
const val = `KW${weekNumber}-${year}`;
|
||||
|
||||
fetch('/generate-pdf', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ week, type })
|
||||
body: JSON.stringify({ val, type })
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
|
||||
Reference in New Issue
Block a user