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

Muhammad Akbar Habiby Khalid #2

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

Conversation

akbarhabiby
Copy link

No description provided.

@dhimashary
Copy link
Contributor

need improvement:

  • validasi email format, validasi email unique
  • validasi title, description, status, duedate tidak boleh kosong/null

@akbarhabiby
Copy link
Author

need improvement:

  • validasi email format, validasi email unique
  • validasi title, description, status, duedate tidak boleh kosong/null

done kak sudah di perbaiki

const status = req.body.status
const patched = await Todo.update({ status }, { where: { id }, returning: true })

res.status(200).json(patched[1][0])
Copy link
Contributor

Choose a reason for hiding this comment

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

lebih baik di cek dulu patched ke 0 nya 0 atau bukan, kalo bukan berarti ada yg keupdate, kalo 0 berarti ga ada yg keupdate

static async deleteTodoById(req, res, next) {
try {
const id = +req.params.id
await Todo.destroy({ where: { id }})
Copy link
Contributor

Choose a reason for hiding this comment

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

ini juga lebih baik di simpan ke variabel dan dilihat hasil deletenya 0 atau bukan, kalo 0 berarti ga ada yg kedelete

@dhimashary
Copy link
Contributor

penamaan file baiknya konsisten ya, misal jika kebab case, kebab case semua ga ada yg camel case. terus superman sama batman nya tolong di rename ya :D

@dhimashary
Copy link
Contributor

good job ! keep up the good work

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