Skip to content
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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

gratatouilley
Copy link

on progress

@dhimashary
Copy link
Contributor

nama file controller diubah ya jadi TodoController

@dhimashary
Copy link
Contributor

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)

@dhimashary
Copy link
Contributor

validasi not null ditambah ya di title, dan description, dan due date

@dhimashary
Copy link
Contributor

tambah model user register login

@dhimashary
Copy link
Contributor

tambah model user untuk register login

try {
const newTodo = req.body
newTodo.UserId = UserId
const create = await Todo.create(newTodo)
Copy link
Contributor

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 })

class UserController {
static async postUserRegister(req, res) {
try {
const newUser = req.body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jangan langsung req body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants