diff --git a/apps/server/src/modules/school/repo/mikro-orm/mapper/school.entity.mapper.ts b/apps/server/src/modules/school/repo/mikro-orm/mapper/school.entity.mapper.ts index f62caccd310..76c339a3243 100644 --- a/apps/server/src/modules/school/repo/mikro-orm/mapper/school.entity.mapper.ts +++ b/apps/server/src/modules/school/repo/mikro-orm/mapper/school.entity.mapper.ts @@ -16,21 +16,13 @@ export class SchoolEntityMapper { const systems = entity.systems?.getItems().map((system) => SystemEntityMapper.mapToDo(system)); const school = new School({ + ...entity, + // id needs to be mapped explicitly because it exists only virtually in the entity id: entity.id, - name: entity.name, - officialSchoolNumber: entity.officialSchoolNumber, - externalId: entity.externalId, - previousExternalId: entity.previousExternalId, - inMaintenanceSince: entity.inMaintenanceSince, - inUserMigration: entity.inUserMigration, currentYear, federalState, - county: entity.county, - purpose: entity.purpose, features, systems, - logo_dataUrl: entity.logo_dataUrl, - fileStorageType: entity.fileStorageType, }); return school;