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

106
Views
Función de almacenamiento de datos múltiples

Hola a todos! esta es mi funcion

 public async create({ request, response }: HttpContextContract) { // find or create team let team: typeof Team let r = request.body if (r.existingTeamId) { team = await Team.findOrFail(r.existingTeamId) } else { team = await Team.create({ title: r.title, size: r.size, }) } // create teammembers r.teamMembers.forEach( async (member) => await TeamMember.create({ ...member, name, position, email, teamId: team.id, }) ) // create training const training = await Training.create({ title: r.title, body: r.training.body }) // create teamLead const teamLead = Team.create({ teamlead_first_name: r.firstName, teamlead_last_name: r.lastName, teamlead_email: r.email, teamlead_id: r.teamLeadId }) return response.json(training) }

Entonces, si habrá una identificación de equipo, encontraré ese equipo si no habrá una identificación de equipo, entonces el usuario debe crear un nuevo equipo, luego, en crear miembros del equipo, el usuario debe agregar varios miembros y allí obtendré team.id, entonces el usuario debe crear capacitación y entonces el líder del equipo está en la mesa de equipos, así que, ¿qué estoy haciendo mal aquí? Soy nuevo en esto, así que esto es muy difícil para mí, ¿alguien puede ayudarme?

about 4 years ago · Santiago Trujillo
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!