Skip to content

Commit

Permalink
Updated endpoints routes
Browse files Browse the repository at this point in the history
ab-elhaddad committed Oct 20, 2023
1 parent a938ff0 commit 5cf09df
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/routes/api/subtaskRouter.ts
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ import { createSubtask, deleteSubtask, revStatus, updateSubtask } from '../../co
import checkUserOfTask from '../../middlewares/security/checkUserOfTask.middleware';

const subtaskRouter = (app: Application) => {
app.post('/subtasks/create', authenticate, createSubtask, errorHandler);
app.delete('/subtasks/delete', authenticate, checkUserOfTask, deleteSubtask, errorHandler);
app.post('/subtasks', authenticate, createSubtask, errorHandler);
app.delete('/subtasks', authenticate, checkUserOfTask, deleteSubtask, errorHandler);
app.put('/subtasks', authenticate, updateSubtask, errorHandler);
app.put('/subtasks/rev-status', authenticate, checkUserOfTask, revStatus, errorHandler);
};
6 changes: 3 additions & 3 deletions src/routes/api/taskRouter.ts
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@ import errorHandler from '../../middlewares/errorHandler.middleware';
import checkUserOfTask from '../../middlewares/security/checkUserOfTask.middleware';

const taskRouter = (app: Application) => {
app.post('/tasks/create', createTaskValidator, authenticate, create, errorHandler);
app.delete('/tasks/delete', deleteTaskValidator, authenticate, checkUserOfTask, deleteTask, errorHandler);
app.post('/tasks', createTaskValidator, authenticate, create, errorHandler);
app.delete('/tasks', deleteTaskValidator, authenticate, checkUserOfTask, deleteTask, errorHandler);
app.put('/tasks', authenticate, checkUserOfTask, updateTask, errorHandler);
app.get('/tasks/get-all', authenticate, getAll, errorHandler);
app.get('/tasks', authenticate, getAll, errorHandler);
app.get('/tasks/get-due-today', authenticate, getDueToday, errorHandler);
app.put('/tasks/rev-status', authenticate, checkUserOfTask, revStatus, errorHandler);
app.put('/tasks/add-to-my-day', authenticate, checkUserOfTask, addToMyDay, errorHandler);

0 comments on commit 5cf09df

Please sign in to comment.