feat(couples): wire pruneDeadTokens into onCoupleLeave
This commit is contained in:
parent
6fda1574ea
commit
c32a5ad8cc
|
|
@ -1,5 +1,6 @@
|
|||
import * as functions from 'firebase-functions'
|
||||
import * as admin from 'firebase-admin'
|
||||
import { pruneDeadTokens } from '../notifications/pruneTokens'
|
||||
|
||||
/**
|
||||
* Firestore trigger that notifies the remaining partner when a user's coupleId
|
||||
|
|
@ -125,6 +126,8 @@ export const onCoupleLeave = functions.firestore
|
|||
console.error(`[onCoupleLeave] some notifications failed:`, failures)
|
||||
}
|
||||
|
||||
await pruneDeadTokens(db, partnerId, tokens, sendResults)
|
||||
|
||||
console.log(
|
||||
`[onCoupleLeave] notified partner ${partnerId} that user ${userId} left couple ${previousCoupleId}`
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue