-
Notifications
You must be signed in to change notification settings - Fork 9
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
FancyTodos Mohammad Fitrah Ramadhan Lamusu #9
base: master
Are you sure you want to change the base?
Conversation
nama file controller diubah ya jadi TodoController |
untuk validasi tanggal tidak bisa menggunakan isAfter karena argsnya jalan ketika server dijalankan, misal server nyala di 17 agustus , di 19 agustus kita masih bisa bikin todo untuk 18 agustus (karena new date nya dibuat saat 17 agustus) |
validasi not null ditambah ya di title, dan description, dan due date |
tambah model user register login |
|
server/controller/todo-controller.js
Outdated
try { | ||
const newTodo = req.body | ||
newTodo.UserId = UserId | ||
const create = await Todo.create(newTodo) |
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.
ini jangan langsung req body, bisa aja di req body gw masukin field yang ga ada di model , jadi musti dipilih dulu misal Todo.create({ title: req.body.title, dst })
server/controller/user-controller.js
Outdated
class UserController { | ||
static async postUserRegister(req, res) { | ||
try { | ||
const newUser = req.body |
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.
jangan langsung req body
…rm still error, add form still error and no 3rd party API
on progress