fixed backend port for shifts

This commit is contained in:
2025-10-10 18:58:48 +02:00
parent 27eea33efc
commit 541af0afee
7 changed files with 34 additions and 9 deletions

View File

@@ -0,0 +1,28 @@
import { db } from '../services/databaseService.js';
import { ShiftTemplate } from '../models/ShiftTemplate.js';
async function checkTemplates() {
try {
const templates = await db.all<ShiftTemplate>(
`SELECT st.*, u.name as created_by_name
FROM shift_templates st
LEFT JOIN users u ON st.created_by = u.id`
);
console.log('Templates:', templates);
for (const template of templates) {
const shifts = await db.all<any>(
`SELECT * FROM template_shifts WHERE template_id = ?`,
[template.id]
);
console.log(`Shifts for template ${template.id}:`, shifts);
}
} catch (error) {
console.error('Error:', error);
} finally {
process.exit();
}
}
checkTemplates();