Fix jwt-token
This commit is contained in:
@@ -88,41 +88,14 @@ async function seedDatabase() {
|
|||||||
console.log('✅ Tumanovsky user already exists for uamils-ab tenant');
|
console.log('✅ Tumanovsky user already exists for uamils-ab tenant');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create test device for API testing if it doesn't exist
|
// Create sample devices if none exist
|
||||||
const testDevice = await Device.findOne({ where: { id: '1941875381' } });
|
|
||||||
if (!testDevice) {
|
|
||||||
await Device.create({
|
|
||||||
id: '1941875381',
|
|
||||||
name: 'Test Device 1941875381',
|
|
||||||
type: 'drone_detector',
|
|
||||||
location: 'Test Location',
|
|
||||||
description: 'Test drone detector device for API testing',
|
|
||||||
is_approved: true,
|
|
||||||
is_active: true,
|
|
||||||
tenant_id: defaultTenant.id,
|
|
||||||
coordinates: JSON.stringify({
|
|
||||||
latitude: 0,
|
|
||||||
longitude: 0
|
|
||||||
}),
|
|
||||||
config: JSON.stringify({
|
|
||||||
detection_range: 25000,
|
|
||||||
alert_threshold: 5000,
|
|
||||||
frequency_bands: ['2.4GHz', '5.8GHz'],
|
|
||||||
sensitivity: 'high'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('✅ Test device 1941875381 created for API testing');
|
|
||||||
} else {
|
|
||||||
console.log('✅ Test device 1941875381 already exists');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check general device count for info
|
|
||||||
const deviceCount = await Device.count();
|
const deviceCount = await Device.count();
|
||||||
if (deviceCount === 1) {
|
if (deviceCount === 0) {
|
||||||
console.log('📝 Only test device exists - add more devices manually through the UI');
|
// REMOVED: Automatic device creation
|
||||||
|
// No longer creating sample devices automatically
|
||||||
|
console.log('📝 No sample devices created - add devices manually through the UI');
|
||||||
} else {
|
} else {
|
||||||
console.log(`✅ ${deviceCount} devices exist in total`);
|
console.log('✅ Devices already exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get admin user for alert rules
|
// Get admin user for alert rules
|
||||||
|
|||||||
Reference in New Issue
Block a user