saifahn / expenseus

A serverless expense tracking app
0 stars 0 forks source link

Fix split #129

Closed saifahn closed 1 year ago

saifahn commented 1 year ago

Overview

Split isn't calculated properly for the TS endpoints.

The Split is saved in DDB as a String, with the format: {"sean.saifahn.li@gmail.com":0,"tomom1.k.725@gmail.com":1} - essentially a JSON.stringified map.

We should handle this for the TS endpoints.

Specs

One thing I was considering was just sending the string value to the backend. One issue is that the FE needs the map/dictionary anyway for the calculations.

If we think about how it might change in the future, I think this makes sense. The FE can use the map as-is in the future potentially.

saifahn commented 1 year ago

The endpoint doesn't stringify it, the ddb function does.

Which I think makes sense - the endpoint doesn't really care about how it is stored in the database.