logicalGoldfish / LenderBee

A trust-based lending and borrowing platform empowering people to share goods and build community
http://lender-bee.herokuapp.com/
4 stars 5 forks source link

closes #306 #310

Closed cyanCYMK closed 9 years ago

cyanCYMK commented 9 years ago

Response to API endpoint /api/items/user/:userId (GET) is array with item and borrower/lender. Example response:

[ 
    {
        "id": 2,
        "title": "turmeric",
        "description": "Turmeric turmeric, it's good for your heart, turmeric turmeric, it'll make you fart",
        "beebucks": 80,
        "borrowed": false,
        "city": "San Francisco",
        "street": "944 Market",
        "state": "CA",
        "country": "USA",
        "imageurl": "http://authoritynutrition.com/wp-content/uploads/2014/03/a-pile-of-fresh-turmeric-roots.jpg",
        "createdAt": "2015-03-05T17:53:32.000Z",
        "updatedAt": "2015-03-05T17:53:32.000Z",
        "borrower_id": 4,
        "lender_id": 1,
        "borrower": {
            "id": 4,
            "fbid": null,
            "username": "samin",
            "firstname": "Samin",
            "lastname": "Sepasi",
            "fbprofile": null,
            "rating": 0,
            "beebucks": 20,
            "city": "San Francisco",
            "state": "CA",
            "street": "890 Market",
            "country": "USA",
            "zipcode": 94103,
            "fbpicture": null,
            "createdAt": "2015-03-02T19:26:38.000Z",
            "updatedAt": "2015-03-02T19:26:38.000Z"
        },
        "lender": {
            "id": 1,
            "fbid": null,
            "username": "devin",
            "firstname": "Devin",
            "lastname": "Otway",
            "fbprofile": null,
            "rating": 4.5,
            "beebucks": 20,
            "city": "San Francisco",
            "state": "CA",
            "street": "60 Rausch",
            "country": "USA",
            "zipcode": 94103,
            "fbpicture": null,
            "createdAt": "2015-03-02T19:26:30.000Z",
            "updatedAt": "2015-03-02T19:29:08.000Z"
        }
    }
]