Code quality improvements from code review
- Add admin-only authorization for company and projects CRUD operations - Create requireAccountId middleware to eliminate code duplication - Standardize error handling (use next(error) consistently) - Change error messages to Slovak language 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ export const getMeetingsByMonth = async (req, res, next) => {
|
||||
data: meetings,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ export const getMeetingById = async (req, res, next) => {
|
||||
data: meeting,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ export const createMeeting = async (req, res, next) => {
|
||||
message: 'Meeting bol vytvorený',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ export const updateMeeting = async (req, res, next) => {
|
||||
message: 'Meeting bol upravený',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -100,6 +100,6 @@ export const deleteMeeting = async (req, res, next) => {
|
||||
message: result.message,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user