Fix jwt-token
This commit is contained in:
@@ -267,7 +267,22 @@ async function createTestDetection(detectionData = {}) {
|
||||
...detectionData
|
||||
};
|
||||
|
||||
return await DroneDetection.create(defaultDetectionData);
|
||||
// Remove any id field to let Sequelize auto-generate UUID
|
||||
delete defaultDetectionData.id;
|
||||
|
||||
// Additional safety check - remove any UUIDV4 function objects
|
||||
Object.keys(defaultDetectionData).forEach(key => {
|
||||
if (defaultDetectionData[key] && typeof defaultDetectionData[key] === 'object' &&
|
||||
defaultDetectionData[key].constructor && defaultDetectionData[key].constructor.name === 'UUIDV4') {
|
||||
delete defaultDetectionData[key];
|
||||
}
|
||||
});
|
||||
|
||||
// Try manual UUID generation as a workaround
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const detectionWithId = { ...defaultDetectionData, id: uuidv4() };
|
||||
|
||||
return await DroneDetection.create(detectionWithId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user