aktueller stand

This commit is contained in:
2026-01-29 18:17:13 +01:00
parent 9f2825edd4
commit ad32f299cf
8 changed files with 491 additions and 18 deletions

View File

@@ -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 || []);
});