The preferred method for creating new instances in TypeORM is to use the .create method. For the most part, we've created instances using new (e.g. new Semester() for making new semester instances). We should, for consistency purposes, change the addAcademicYear function to create new instances using the TypeORM .create method instead.
The preferred method for creating new instances in TypeORM is to use the
.create
method. For the most part, we've created instances usingnew
(e.g.new Semester()
for making new semester instances). We should, for consistency purposes, change theaddAcademicYear
function to create new instances using the TypeORM.create
method instead.TypeORM repository documentation: https://github.com/typeorm/typeorm/blob/master/docs/repository-api.md