feat(push): smart push queueing with page-visibility fast path and app-ping/pong fallback
This commit is contained in:
+2
-2
@@ -394,9 +394,9 @@ async function start(): Promise<void> {
|
||||
});
|
||||
|
||||
app.post('/api/push/subscribe', authMiddleware, (req: Request, res: Response) => {
|
||||
const { subscription } = req.body as { subscription?: { endpoint?: string } };
|
||||
const { subscription, deviceId } = req.body as { subscription?: { endpoint?: string }; deviceId?: string };
|
||||
if (!subscription?.endpoint) return res.status(400).json({ error: 'Missing subscription' });
|
||||
saveSubscription(subscription as any);
|
||||
saveSubscription(subscription as any, deviceId);
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user