Shiv2205 / SOEN_390_Team_20

https://soen-390-team-20.vercel.app/
2 stars 0 forks source link

BackEnd - Fetch Units by User ID #56

Closed Aly-Hussein closed 4 months ago

Aly-Hussein commented 4 months ago

Currently, the route only returns one unit details object given the user's ID like this:


{                    

  "status": number,
  "data": { 
    "unit_id": string,
    "property_id": string,
    "size": number,
    "monthly_rent": number,
    "condo_fee": number,
    "condo_balance": number

  },             

  "message": string

}                

We need it to return an array of all the units that a specific user owns / rents like this :

{
"status": number,
  "data": [
    {
      "unit_id": string,
      "property_id": string,
      "size": number,
      "monthly_rent": number,
      "condo_fee": number,
      "condo_balance": number

    }
],
"message": string

Also, it would be nice if we can append the Unit's Building's Details in the array as well like this:

{
"status": number,
  "data": [
    {
      unit: 
      {
      "unit_id": string,
      "property_id": string,
      "size": number,
      "monthly_rent": number,
      "condo_fee": number,
      "condo_balance": number
       },
       building: 
       {
         insert building details here
       }

    }
],
"message": string
Aly-Hussein commented 4 months ago

just fixed with lates merge to main by @Shiv2205