fix api route
This commit is contained in:
parent
0e22240d11
commit
6381038c90
@ -55,7 +55,7 @@ async function subscribeToNotifications() {
|
|||||||
applicationServerKey: urlBase64ToUint8Array(publicVapidKey)
|
applicationServerKey: urlBase64ToUint8Array(publicVapidKey)
|
||||||
});
|
});
|
||||||
|
|
||||||
const res = await apiCall('/subscribe', 'POST', subscription);
|
const res = await apiCall(' /subscribe', 'POST', subscription);
|
||||||
|
|
||||||
// If the subscription is saved successfully, set a flag so we don't do it again
|
// If the subscription is saved successfully, set a flag so we don't do it again
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|||||||
@ -204,8 +204,7 @@ function setupRoutes() {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
app.post('/subscribe', authenticateToken, async (req, res) => {
|
app.post('/api/subscribe', authenticateToken, async (req, res) => { try {
|
||||||
try {
|
|
||||||
const subscription = req.body;
|
const subscription = req.body;
|
||||||
const userId = req.user.id;
|
const userId = req.user.id;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user