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

237
Views
¿Cómo eliminar varias identificaciones de req.params en la secuencia?

¿Cómo aceptar req.params que contienen múltiples ID? Quiero buscar y eliminar la identificación múltiple

aquí está mi código:

 const id = req.params; const masterFunders = await masterFunder.findOne({ where: { id: ids } }) if (!masterFunders) { return res.API.error(RESPONSE_MESSAGE.file_not_found, 400) } if (masterFunders.createdAt.getTime() > new Date().getTime() - (1000 * 60 * 60 * 24 * 10 * 3)) { return res.API.error(RESPONSE_MESSAGE.cannot_delete_file, 400) } await masterFunder.destroy({ where: { id: ids } }); return res.API.success(RESPONSE_MESSAGE.success, 200) } catch (error) { console.log(error) return res.API.error(error.message)

es un error

 { "status": false, "message": "Invalid value {\n id: '[de7cc75d-4925-4a8d-869c-9072c7310fc9, b9da8552-e3f9-4628-a5a2-9709399b20dc]'\n}", "meta": {} }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

"ids" parece ser una cadena que contiene una matriz en formato JSON, no una matriz de JavaScript.

Entonces debes hacer: ids = JSON.parse(ids); para convertir la cadena en una matriz de JavaScript :)

about 4 years ago · Juan Pablo Isaza Report
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!