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

createNewsController, tidak menggunakan transaction, gabisa menambahkan topic baru. #1

Open
mandaputtra opened this issue Aug 26, 2021 · 1 comment

Comments

@mandaputtra
Copy link

Jikalau ada banyak query seperti dilihat di create news controller, harusnya memakai transaction. Coba dilihat contohnya disini https://vincit.github.io/objection.js/guide/transactions.html#transactions

Payload yang aku maksud pas create news itu begini

{
  title: 'jakarta sedang banjir',
  body: 'banjurrrrrrr'
  status: 'publish',
  topics: ['bencana alam', 'banjir']
}

Spesifikasi pada saat create news

  1. title, body, status, required
  2. topics juga required paling tidak satu tidak menggunakan topic_id gunakan string nama topic.
  3. topics yang belum ada pada database di bikin. yang sudah ada tinggal di insert.

Fungsi getNewsByTopicId ini maksudnya apa yak?

@gelembungsahabat
Copy link
Owner

gelembungsahabat commented Aug 26, 2021

ahh iya kelupaan yang getNewsByTopicId belum aku ganti namanya aowkwk. getNewsByTopicId itu ngambil data dari db berdasarkan title nya sih Mas, biar ga duplicate..

okee Mas, aku revisi lagi.. thank you :D

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

No branches or pull requests

2 participants