This commit is contained in:
@@ -44,7 +44,7 @@ export const seedWarranty = async (logger: Logger) => {
|
||||
// Check for existing warranties and only create new ones to avoid duplicate key errors
|
||||
let createdCount = 0;
|
||||
let skippedCount = 0;
|
||||
|
||||
|
||||
for (const warranty of cleanedWarranties) {
|
||||
const existing = await WarrantyModel.findOne({ name: warranty.name });
|
||||
if (!existing) {
|
||||
@@ -64,7 +64,7 @@ export const seedWarranty = async (logger: Logger) => {
|
||||
skippedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
logger.info(`Warranty seeding complete! (${createdCount} created, ${skippedCount} skipped)`);
|
||||
} else {
|
||||
logger.warn("No valid warranties found after filtering");
|
||||
|
||||
Reference in New Issue
Block a user