Skip to content

Commit

Permalink
fix: fixed mongo device deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrache committed Oct 6, 2023
1 parent 1b30f38 commit 449bfaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data/mongo/collections/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export class MongoDeviceTable implements IDeviceTable {
return this.collection.findOne({ guid: id, tenantId }) as unknown as WithId<Device>
}

async delete (name: string, tenantId: string = ''): Promise<boolean> {
const result = await this.collection.deleteOne({ friendlyName: name, tenantId })
async delete (id: string, tenantId: string = ''): Promise<boolean> {
const result = await this.collection.deleteOne({ guid: id, tenantId: tenantId })

Check failure on line 37 in src/data/mongo/collections/device.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected property shorthand
return result.deletedCount && result.deletedCount > 0
}

Expand Down

0 comments on commit 449bfaf

Please sign in to comment.