diff --git a/lib/seeders/class-seeder.ts b/lib/seeders/class-seeder.ts index 81f77d7..f53bf77 100644 --- a/lib/seeders/class-seeder.ts +++ b/lib/seeders/class-seeder.ts @@ -51,7 +51,7 @@ export class ClassSeeder< const refs = pilferReferences(records); ctx.unresolvedReferences = ctx.unresolvedReferences.concat(refs); this.logger.debug(`Saving records ...`); - let saved = await repo.save(records); + let saved = await repo.save(records.map(r => ({...r}))); ctx.savedEntities.set(this.seedClass, saved); this.logger.debug(`Saved.`); const resolvePromises = []; diff --git a/package-lock.json b/package-lock.json index ff53eb1..e033d14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nestjs-class-seeder", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nestjs-class-seeder", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "dependencies": { "@faker-js/faker": "^7.4.0", diff --git a/package.json b/package.json index 2b71e56..a6634af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nestjs-class-seeder", - "version": "1.2.1", + "version": "1.2.2", "description": "An extension library for NestJS to perform seeding. Forked from nestjs-seeder", "main": "dist/index.js", "types": "dist/index.d.ts",