v1.0.3
add multi lang
This commit is contained in:
@@ -35,14 +35,14 @@ function getMembers(householdId) {
|
||||
function requireHousehold(req, res, next) {
|
||||
const householdId = req.headers['x-household-id'];
|
||||
if (!householdId) {
|
||||
return res.status(400).json({ error: 'Nie wybrano gospodarstwa (brak nagłówka X-Household-Id)' });
|
||||
return res.status(400).json({ error: 'household_not_selected' });
|
||||
}
|
||||
if (!isMember(householdId, req.userId)) {
|
||||
return res.status(403).json({ error: 'Nie jesteś członkiem tego gospodarstwa' });
|
||||
return res.status(403).json({ error: 'not_a_household_member' });
|
||||
}
|
||||
const household = getHouseholdById(householdId);
|
||||
if (!household) {
|
||||
return res.status(404).json({ error: 'Gospodarstwo nie znalezione' });
|
||||
return res.status(404).json({ error: 'household_not_found' });
|
||||
}
|
||||
req.household = household;
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user