saifahn / expenseus

A serverless expense tracking app
0 stars 0 forks source link

Use JSON instead of FormData #127

Closed saifahn closed 1 year ago

saifahn commented 1 year ago

Overview

The new API routes use JSON instead of FormData - I thought it would be easier to test and we also don't have images so we don't need FormData...

Affected files:

Although, perhaps I'm doing something completely wrong - the POST /trackers route doesn't seem to be accepting the payload correctly hmmm

saifahn commented 1 year ago

The stuff about the trackers route - it was because I wasn't doing JSON.parse in the handler - this has been updated.

One thing was that the req._setBody method on the mock requests in the tests didn't make it easy to set JSON there, so I just assigned it with req.body =