This commit is contained in:
@@ -29,5 +29,6 @@ import { ChatModule } from '../chat/chat.module';
|
||||
],
|
||||
controllers: [RequestController],
|
||||
providers: [RequestService, RequestRepository, RequestListeners],
|
||||
exports: [RequestService],
|
||||
})
|
||||
export class RequestModule {}
|
||||
|
||||
@@ -219,10 +219,14 @@ export class RequestService {
|
||||
});
|
||||
}
|
||||
|
||||
private async hardDeleteRequest(id: string, em: EntityManager) {
|
||||
await this.chatService.deleteChatsByRefId(id, em);
|
||||
await em.nativeUpdate(Invoice, { requestId: id }, { requestId: null });
|
||||
async hardDeleteRequestAndItems(id: string, em: EntityManager) {
|
||||
await em.nativeDelete(RequestItem, { request: { id } });
|
||||
await em.nativeDelete(Request, { id });
|
||||
}
|
||||
|
||||
private async hardDeleteRequest(id: string, em: EntityManager) {
|
||||
await this.chatService.deleteChatsByRefId(id, em);
|
||||
await em.nativeUpdate(Invoice, { requestId: id }, { requestId: null });
|
||||
await this.hardDeleteRequestAndItems(id, em);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user