IO-244 Resolve IOU

This commit is contained in:
Patrick Fic
2021-12-15 14:34:24 -08:00
parent 1b8a76d5e0
commit e46d5b833b
9 changed files with 71 additions and 4 deletions

View File

@@ -118,6 +118,21 @@ exports.subscribe = async (req, res) => {
res.json(result);
};
exports.unsubscribe = async (req, res) => {
try {
const result = await admin
.messaging()
.unsubscribeFromTopic(
req.body.fcm_tokens,
`${req.body.imexshopid}-${req.body.type}`
);
res.json(result);
} catch (error) {
res.sendStatus(500);
}
};
exports.validateFirebaseIdToken = async (req, res, next) => {
if (
(!req.headers.authorization ||