aktueller stand
This commit is contained in:
17
server.js
17
server.js
@@ -1317,6 +1317,23 @@ app.post('/api/notifications/test', requireAuth, async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/stores/:storeId/regular-pickup', requireAuth, async (req, res) => {
|
||||
const { storeId } = req.params;
|
||||
if (!storeId) {
|
||||
return res.status(400).json({ error: 'Store-ID fehlt' });
|
||||
}
|
||||
try {
|
||||
const rules = await withSessionRetry(
|
||||
req.session,
|
||||
() => foodsharingClient.fetchRegularPickup(storeId, req.session.cookieHeader, req.session),
|
||||
{ label: 'fetchRegularPickup' }
|
||||
);
|
||||
res.json(Array.isArray(rules) ? rules : []);
|
||||
} catch (error) {
|
||||
res.status(400).json({ error: error.message || 'Regular-Pickup konnte nicht geladen werden' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/stores', requireAuth, async (req, res) => {
|
||||
res.json(req.session.storesCache?.data || []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user