mirror of
https://github.com/Matewoo/pdf-writer.git
synced 2026-11-18 18:42:50 +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');
|
const { exec } = require('child_process');
|
||||||
|
|
||||||
app.post('/generate-pdf', (req, res) => {
|
app.post('/generate-pdf', (req, res) => {
|
||||||
const { week, type } = req.body;
|
const { val, type } = req.body;
|
||||||
let pdfPath;
|
let pdfPath;
|
||||||
console.log('Type:', type);
|
console.log('Type:', type);
|
||||||
console.log('Week:', week);
|
console.log('Val:', val);
|
||||||
|
|
||||||
if (type === 'week') {
|
if (type === 'week') {
|
||||||
console.log('Generating PDF for week:', week);
|
console.log('Generating PDF for week:', val);
|
||||||
pdfPath = `python.exe .\\scripts\\writePdf.py ${week}`;
|
pdfPath = `python.exe .\\scripts\\writePdf.py ${val}`;
|
||||||
} else {
|
} 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) {
|
function generatePDF(type) {
|
||||||
const weekNumber = getWeekNumber(currentWeek);
|
const weekNumber = getWeekNumber(currentWeek);
|
||||||
const year = currentWeek.getFullYear();
|
const year = currentWeek.getFullYear();
|
||||||
const week = `KW${weekNumber}-${year}`;
|
const val = `KW${weekNumber}-${year}`;
|
||||||
|
|
||||||
fetch('/generate-pdf', {
|
fetch('/generate-pdf', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ week, type })
|
body: JSON.stringify({ val, type })
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user