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:
@@ -8,7 +8,7 @@ import { NotFoundError } from '../utils/errors.js';
|
||||
* Optionally filter by search, project, company, assigned user, or status
|
||||
*/
|
||||
export const getAllTodos = async (filters = {}) => {
|
||||
const { searchTerm, projectId, companyId, assignedTo, status } = filters;
|
||||
const { searchTerm, projectId, companyId, assignedTo, status, priority } = filters;
|
||||
|
||||
// If filtering by assignedTo, we need to join with todo_users
|
||||
if (assignedTo) {
|
||||
@@ -48,6 +48,10 @@ export const getAllTodos = async (filters = {}) => {
|
||||
conditions.push(eq(todos.status, status));
|
||||
}
|
||||
|
||||
if (priority) {
|
||||
conditions.push(eq(todos.priority, priority));
|
||||
}
|
||||
|
||||
if (conditions.length > 0) {
|
||||
query = query.where(and(...conditions));
|
||||
}
|
||||
@@ -119,6 +123,10 @@ export const getAllTodos = async (filters = {}) => {
|
||||
conditions.push(eq(todos.status, status));
|
||||
}
|
||||
|
||||
if (priority) {
|
||||
conditions.push(eq(todos.priority, priority));
|
||||
}
|
||||
|
||||
if (conditions.length > 0) {
|
||||
query = query.where(and(...conditions));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user