diff --git a/src/services/damplab-services.services.ts b/src/services/damplab-services.services.ts index d9335dc..96800e9 100644 --- a/src/services/damplab-services.services.ts +++ b/src/services/damplab-services.services.ts @@ -32,9 +32,12 @@ export class DampLabServices { async delete(service: DampLabService): Promise { // Remove all allowed connections first - await this.dampLabServiceModel.updateMany({}, { + await this.dampLabServiceModel.updateMany( + {}, + { $pull: { allowedConnections: service._id } - }); + } + ); await this.dampLabServiceModel.deleteOne({ _id: service._id }); }