add changes

This commit is contained in:
AD2025
2025-12-26 23:56:32 +02:00
parent 410c3d725f
commit e7d26bc981
127 changed files with 36162 additions and 0 deletions

40
tests/test-find-by-pk.js Normal file
View File

@@ -0,0 +1,40 @@
const { Category } = require('../models');
async function testFindByPk() {
try {
console.log('\n=== Testing Category.findByPk(1) ===\n');
const category = await Category.findByPk(1, {
attributes: [
'id',
'name',
'slug',
'description',
'icon',
'color',
'questionCount',
'displayOrder',
'guestAccessible',
'isActive'
]
});
console.log('Result:', JSON.stringify(category, null, 2));
if (category) {
console.log('\nCategory found:');
console.log(' Name:', category.name);
console.log(' isActive:', category.isActive);
console.log(' guestAccessible:', category.guestAccessible);
} else {
console.log('Category not found!');
}
process.exit(0);
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
}
testFindByPk();