Security improvements, role in user creation, todo filters fix
- Remove better-auth dependency (unused) - Update JWT secrets to stronger values - Add ENCRYPTION_SALT env variable for password encryption - Add role field to createUserSchema validator - Accept role from body in admin.controller createUser - Fix todo filters: add priority filter, handle completed param - Remove .env.example (merged into .env) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,21 @@ import { formatErrorResponse } from '../utils/errors.js';
|
||||
*/
|
||||
export const getAllTodos = async (req, res) => {
|
||||
try {
|
||||
const { search, projectId, companyId, assignedTo, status } = req.query;
|
||||
const { search, projectId, companyId, assignedTo, status, completed, priority } = req.query;
|
||||
|
||||
// Handle both 'status' and 'completed' query params
|
||||
let statusFilter = status;
|
||||
if (completed !== undefined) {
|
||||
statusFilter = completed === 'true' ? 'completed' : 'pending';
|
||||
}
|
||||
|
||||
const filters = {
|
||||
searchTerm: search,
|
||||
projectId,
|
||||
companyId,
|
||||
assignedTo,
|
||||
status,
|
||||
status: statusFilter,
|
||||
priority,
|
||||
};
|
||||
|
||||
const todos = await todoService.getAllTodos(filters);
|
||||
|
||||
Reference in New Issue
Block a user