refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8186)
Follow-up to: #8163
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Container } from 'typedi';
|
||||
import type { DeleteResult, InsertResult } from 'typeorm';
|
||||
import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow';
|
||||
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
|
||||
import { Logger } from '@/Logger';
|
||||
@@ -92,7 +91,7 @@ export abstract class MessageEventBusDestination implements MessageEventBusDesti
|
||||
id: this.getId(),
|
||||
destination: this.serialize(),
|
||||
};
|
||||
const dbResult: InsertResult = await Container.get(EventDestinationsRepository).upsert(data, {
|
||||
const dbResult = await Container.get(EventDestinationsRepository).upsert(data, {
|
||||
skipUpdateIfNoValuesChanged: true,
|
||||
conflictPaths: ['id'],
|
||||
});
|
||||
@@ -103,7 +102,7 @@ export abstract class MessageEventBusDestination implements MessageEventBusDesti
|
||||
return MessageEventBusDestination.deleteFromDb(this.getId());
|
||||
}
|
||||
|
||||
static async deleteFromDb(id: string): Promise<DeleteResult> {
|
||||
static async deleteFromDb(id: string) {
|
||||
const dbResult = await Container.get(EventDestinationsRepository).delete({ id });
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user