Skip to content

Commit 35bb2ff

Browse files
committed
add delayed notification action creator
1 parent 9619c04 commit 35bb2ff

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/actions/users.js

+13
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,17 @@ export function notifyMeAction(fcm) {
4242
return { error: e }
4343
});
4444
}
45+
}
46+
47+
export function notifyMeWithDelayAction(fcm) {
48+
49+
return dispatch => {
50+
axios.get('http://localhost:8080/api/notify-with-delay/'+fcm).then(res=>{
51+
dispatch(notificationSentStatusAction("Success"));
52+
}).catch((e) => {
53+
console.log("Notifying via fcm failed!!", e);
54+
dispatch(notificationSentStatusAction("Failed"));
55+
return { error: e }
56+
});
57+
}
4558
}

0 commit comments

Comments
 (0)