feat(notifications): add POST /refresh schedule response
Return shouldNotify and nextNotifications with a 10-minute lookahead timestamp for the app schedule API.
This commit is contained in:
@@ -7,6 +7,15 @@ notificationsRouter.get("/", (_req, res) => {
|
||||
res.json({ ok: true, resource: "notifications" });
|
||||
});
|
||||
|
||||
notificationsRouter.post("/refresh", async (_req, res) => {
|
||||
const now = Date.now();
|
||||
|
||||
res.json({
|
||||
shouldNotify: true,
|
||||
nextNotifications: [{ timestamp: now + 600000 }],
|
||||
});
|
||||
});
|
||||
|
||||
notificationsRouter.post("/register", async (req, res) => {
|
||||
const { fcmToken, platform, testMode } = req.body as {
|
||||
fcmToken?: unknown;
|
||||
|
||||
Reference in New Issue
Block a user