Closed gabrielegranello closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
fairhold-dashboard | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 26, 2024 9:28am |
What does this PR do?
It allows for the Farihold calculation to happen in the API. See #69
Before this PR
The API
route.ts
used to fetch the data and pass it to the frontend. Then, the Fairhold calculations used to happen in the frontend.Now
The API
route.ts
also computes the Fairhold calculations, and it returns the results to the frontend.Side issue/fix
I think that there was mismatch in how we were dealing with
socialRentAdjustements
. Specifically: 1) Data such as inflation are type of number in the database 2)socialRentAdjustmentsRepo.ts
was converting the data into string || null 3) Later, this data was treated as numbers to perform the calculationsWithin socialRentAdjustmentsRepo.ts I deleted the conversion to
string
and set up a clause guard to check fornull
.Not sure if that's the best approach