Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

454
Views
Cómo crear datos y devolverlos con una asociación en Sequelize

Primero, perdón por el mal inglés, hablante no nativo. En Sequelize, he creado un CRUD sin problemas, una gran herramienta ORM, aún así me gustaría crear y devolver datos específicos con una asociación.

 async create(req, res){ const {minRoll,maxRoll,typeName} = req.body; const actionType = await ActionType.findOne({ where: {name: typeName} }); if(!actionType){ return res.json({result:false}); } const {id} = actionType; const action = await Action.create({ minRoll: minRoll, maxRoll: maxRoll, type_id: id }); return res.json(action); },

¿Cómo crear y devolver acción con una asociación ? Este es mi regreso en Postman en este momento:

 "id": 61, "minRoll": 1, "maxRoll": 3, "type_id": 20
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!