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

227
Views
¿Falló la validación de la solicitud de celebración?

Recibo este extraño error cada vez que intento publicar algo en mi sitio. Es un campo donde el usuario puede ingresar texto o ingresar un archivo multimedia como una foto o un video. Pero cuando trato de ingresar texto, aparece este error. Por lo tanto, no puedo publicar nada de texto o imagen.

 {statusCode: 400, error: "Bad Request", message: "celebrate request validation failed",…} error: "Bad Request" message: "celebrate request validation failed" statusCode: 400 validation: {body: {source: "body", keys: ["file"], message: ""file" is not allowed"}} body: {source: "body", keys: ["file"], message: ""file" is not allowed"} keys: ["file"] message: "\"file\" is not allowed" source: "body"

Mi Front End está construido con React.

 const handleStoryCreate = useCallback(async () => { try { setLoading(true); const data = { text: inputValue, }; const schema = Yup.object().shape({ text: Yup.string().required('Texto obrigatório'), }); await schema.validate(data, { abortEarly: false }); const formData = new FormData(); formData.append('text', data.text); formData.append('file', fileImage); await api.post('stories', formData, { headers: { 'content-type': 'multipart/form-data', Authorization: `Bearer ${session.accessToken}`, }, });

Aquí la ruta:

 router.post( '/', ensureAuthorization('user'), ensureFiles('file', false), resize, celebrate({ [Segments.BODY]: { text: Joi.string().required(), }, }), storiesController.create, );
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!