diff --git a/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.ts b/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.ts index f843bb4af3b..105f546fc0c 100644 --- a/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.ts +++ b/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.ts @@ -10,20 +10,8 @@ export class UserLoginMigrationRevertService { private readonly schoolService: SchoolService ) {} - async revertUserLoginMigration(userLoginMigration: UserLoginMigrationDO): Promise { + async revertUserLoginMigration(userLoginMigration: UserLoginMigrationDO): Promise { await this.schoolService.removeFeature(userLoginMigration.schoolId, SchoolFeatures.OAUTH_PROVISIONING_ENABLED); await this.userLoginMigrationService.deleteUserLoginMigration(userLoginMigration); - - const revertedUserLoginMigration = new UserLoginMigrationDO({ - schoolId: userLoginMigration.schoolId, - targetSystemId: userLoginMigration.targetSystemId, - startedAt: undefined, - finishedAt: undefined, - mandatorySince: undefined, - closedAt: undefined, - sourceSystemId: undefined, - }); - - return revertedUserLoginMigration; } } diff --git a/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.ts b/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.ts index 638f084d1a5..ad6646edae8 100644 --- a/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.ts +++ b/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.ts @@ -46,12 +46,10 @@ export class CloseUserLoginMigrationUc { const hasSchoolMigratedUser: boolean = await this.schoolMigrationService.hasSchoolMigratedUser(schoolId); if (!hasSchoolMigratedUser) { - const revertedUserLoginMigration: UserLoginMigrationDO = - await this.userLoginMigrationRevertService.revertUserLoginMigration(updatedUserLoginMigration); - - return revertedUserLoginMigration; + await this.userLoginMigrationRevertService.revertUserLoginMigration(updatedUserLoginMigration); + } else { + await this.schoolMigrationService.markUnmigratedUsersAsOutdated(schoolId); } - await this.schoolMigrationService.markUnmigratedUsersAsOutdated(schoolId); return updatedUserLoginMigration; }