The Ultimate React Native Series: Advanced Concepts 14-Posting Data does not work

I am following the video for The Ultimate React Native Series: Advanced Concepts 14-Posting Data but the code is out of date and does not explain how to create a validation with Joi in teh backend. I get an error

TypeError: Joi.validate is not a function
at /Users/gerardocianciulli/Documents/done-with-it/backend/middleware/validation.js:4:22

when I looked this up i saw to replace Joi with schema but that returns the error

TypeError: schema.validate is not a function
at /Users/gerardocianciulli/Documents/done-with-it/backend/middleware/validation.js:4:22

I’m also experiencing the same thing and haven’t found a solution yet

It works now… use @dansatch code :backhand_index_pointing_down:t3:

Then in your DoneWithIt folder under api/listings.js

Replace your return type from:

return client.post(endpoint, data);

To:

return client.post(endpoint, data, {

   **header: {'Content-Type': 'multipart/form-data'},**

});

Solution by @Alo :backhand_index_pointing_down:t3:

Thanks for the help this works.

1 Like