-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Andhika Muttaqien #44
base: main
Are you sure you want to change the base?
Conversation
03 - Auth (Authenctication, Authorization, access_token > Done) *notes : Third API = Covid19 Global Summary Info > "Whatever your Todolist, please stay safe" |
### (With Postman) | ||
|
||
[Link to Postman API-documentation](https://documenter.getpostman.com/view/13589681/TVev662F#8280994e-0cfc-4583-b39e-bb3a7fc3f1e3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oke lumayan lengkap ya response nya
@@ -0,0 +1,42 @@ | |||
module.exports = (err, req, res, next) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice lengkap ya
due_date: { | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
validate: { | ||
notEmpty: { | ||
args: true, | ||
msg: 'Due Date Cannot be Empty', | ||
}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
di handle ya ga boleh masukin sebelum hari ini
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh iya kak saya masukin nya lgsg di pas controller jadi sebelum create dan edit sudah di cek. kalau gitu gpp ga kak? atau di double saja ya?
`let dueDate = new Date(newTodo.due_date);
let currentDate = new Date();
if (dueDate < currentDate) {
const errorName = 'DueDateMustGratherThanToday';
next({
name: errorName,
});`
TodoRoutes.use(authentication); | ||
|
||
TodoRoutes.post('/', TodoController.createTodo); | ||
|
||
TodoRoutes.get('/', TodoController.getTodos); | ||
|
||
TodoRoutes.get('/:id', TodoController.getTodoId); | ||
|
||
TodoRoutes.put('/:id', authorization, TodoController.editTodo); | ||
|
||
TodoRoutes.patch('/:id', authorization, TodoController.editStatus); | ||
|
||
TodoRoutes.delete('/:id', authorization, TodoController.deleteTodo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice ya routing nya
05 - Client (Done) |
Commit Final -
|
01-Rest-API-doucmentation - done (postman documentation link on README.md)
02-Rest-API - done
03-auth - register & login done