Browse Source

fix(api): fix sentSMSCount update issue

pull/19/head
isra el 2 years ago
parent
commit
7c10b5d3c4
  1. 4
      api/src/gateway/gateway.service.ts

4
api/src/gateway/gateway.service.ts

@ -99,7 +99,9 @@ export class GatewayService {
.sendToDevice(device.fcmToken, payload, { priority: 'high' })
this.deviceModel
.findByIdAndUpdate(deviceId, { $inc: { sentSMSCount: 1 } })
.findByIdAndUpdate(deviceId, {
$inc: { sentSMSCount: smsData.receivers.length },
})
.exec()
.catch((e) => {
console.log('Failed to update sentSMSCount')

Loading…
Cancel
Save