From 382e70bf7b3fe2527f7497f9104b5183de6fa76d Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 25 Mar 2023 12:00:00 +0100 Subject: [PATCH] fix: replace Equals constructor TypeORMs Equals constructor is still broken, so this commit removes all remaining usages. See https://github.com/hedgedoc/hedgedoc/issues/2467 Signed-off-by: David Mehren --- backend/src/revisions/revisions.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/revisions/revisions.service.ts b/backend/src/revisions/revisions.service.ts index d36c8c474..c853f64d1 100644 --- a/backend/src/revisions/revisions.service.ts +++ b/backend/src/revisions/revisions.service.ts @@ -6,7 +6,7 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { createPatch } from 'diff'; -import { Equal, Repository } from 'typeorm'; +import { Repository } from 'typeorm'; import { NotInDBError } from '../errors/errors'; import { ConsoleLoggerService } from '../logger/console-logger.service'; @@ -49,7 +49,7 @@ export class RevisionsService { async purgeRevisions(note: Note): Promise { const revisions = await this.revisionRepository.find({ where: { - note: Equal(note), + note: { id: note.id }, }, }); const latestRevision = await this.getLatestRevision(note); @@ -65,7 +65,7 @@ export class RevisionsService { const revision = await this.revisionRepository.findOne({ where: { id: revisionId, - note: Equal(note), + note: { id: note.id }, }, }); if (revision === null) { @@ -79,7 +79,7 @@ export class RevisionsService { async getLatestRevision(note: Note): Promise { const revision = await this.revisionRepository.findOne({ where: { - note: Equal(note), + note: { id: note.id }, }, order: { createdAt: 'DESC',