Skip to content

Latest commit

 

History

History
123 lines (88 loc) · 1.9 KB

File metadata and controls

123 lines (88 loc) · 1.9 KB

Need to update response data for auth routes

GET USER BY ID

Method Url: /api/users/:id

HTTP method: [GET]

Response

200 (OK)
    {
        "userId": 2,
        "username": "linda",
        "password": "$2a$11$d6mtGCQJBekPkqHvyog7GuaE82AfjcXzytL3ELtR8Dc.ENBNu7i/a",
        "firstname": "Linda",
        "lastname": "La",
        "email": "linda@gmail.com",
        "phone": 5102382227
    }

GET POSTS BY USERID

Method Url: /api/users/:id/posts

HTTP method: [GET]

Response

200 (OK)
[
    {
        "itemId": 1,
        "owner": 1,
        "title": "Portable Speaker",
        "description": "Great speaker for a gathering or party",
        "brand": "Bose",
        "model": "5000XL",
        "label": "Speaker",
        "dailyPrice": 100,
        "weeklyPrice": 450,
        "available": 1,
        "renter": null
    },
    {
        "itemId": 6,
        "owner": 1,
        "title": "32 inch Curve Monitor",
        "description": "Dominate your enemies with this awesome monitor",
        "brand": "Samsung",
        "model": "32xl",
        "label": "Monitor",
        "dailyPrice": 60,
        "weeklyPrice": 250,
        "available": 0,
        "renter": 3
    }
]

UPDATE USER

Method Url: /api/users/:id

HTTP method: [PATCH]

Response

202 (Accepted)
{
    "message": "User: matt04 has been updated"
}

DELETE USER

Method Url: /api/users/:id

HTTP method: [DELETE]

Response

202 (Accepted)
{
    "message": "The user has been deleted."
}

UPLOAD ITEM IMAGE

Method Url: /api/items/upload

HTTP method: [POST]

Response

200 (Accepted)
{
    "message": "Your image has been uploaded successfully to cloudinary",
    "image": "http://res.cloudinary.com/tommaay/image/upload/v1549493382/lthab7knnbzjgcdpfvx9.jpg"
}