Resolve unsub issue.
This commit is contained in:
@@ -35,11 +35,17 @@ export function ProfileShopsContainer({ bodyshop }) {
|
||||
const updateActiveShop = async (activeShopId) => {
|
||||
logImEXEvent("profile_change_active_shop");
|
||||
|
||||
await axios.post("/notifications/unsubscribe", {
|
||||
fcm_tokens: await getToken(messaging),
|
||||
imexshopid: bodyshop.imexshopid,
|
||||
type: "messaging",
|
||||
});
|
||||
try {
|
||||
const fcm_tokens = await getToken(messaging);
|
||||
|
||||
await axios.post("/notifications/unsubscribe", {
|
||||
fcm_tokens,
|
||||
imexshopid: bodyshop.imexshopid,
|
||||
type: "messaging",
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("No FCM token. Skipping unsubscribe.");
|
||||
}
|
||||
await Promise.all(
|
||||
data.associations.map(async (record) => {
|
||||
await updateAssocation({
|
||||
|
||||
Reference in New Issue
Block a user