Documentation
Section Contents:
- Endpoints
- Create new User
- Login
- Get all items in Database
- Get item by ID
- Add Item
- Delete Item by ID from database
- Add item by owner
- Get item by User
- Get User by ID
- Delete user by ID
[
{id: 1, username: 'test', password:'123', department:'owner'},
{id: 2, username: 'db', password:'123', department:'owner'}
]
[
{ id: 1,
item_name:'Roomba',
description:'Does the cleaning for you',
user_id: 2,
availability: true,
daily_rate: 20,
condition: "Great",
location: 'LA'
},
{ id: 2,
item_name:'XXL Megaphone',
description:'Obnoxiously loud ',
user_id: 1,
availability: true,
daily_rate: 15,
condition: "It works",
location: 'LA'
}
]
Expects an object with this format as the request body:
{
"username": "user1", //string (required)
"password": "password", //string (required)
"department": "owner or renter" //string (required)
}
Expects an object with this correct credentials stored in the APi:
{
"username": "db", //string (required)
"password": "123", //string (required)
}
Will return all items in the database and their information, looking something like this...
[
{
"id": 1,
"item_name": "Roomba",
"description": "Does the cleaning for you",
"user_id": 2,
"availability": 1,
"daily_rate": 20,
"condition": "Great",
"location": "LA"
}
]
Note-':id' will be replaced by items id number
Will return a single item based off of provided id
Example of data needed:
Will add an item to the database
"item_name": "3D Printer", //string
"description": "it's 3D", //string
"user_id": 3, //integer
"availability": 1, //boolean
"daily_rate": 75, //integer
"condition": "Not a Scratch", //string
"location": "AZ" //string,
"imgs":"" //string
Note-':id' will be replaced by items id number
Will delete the user from the database
Used to create an item, assigned to user_id
Example of data that can be inputed:
"item_name": "3D Printer", //string required
"description": "it's 3D", //string required
"availability": 1, //boolean
"daily_rate": 75, //integer
"condition": "Not a Scratch", //string required
"location": "AZ" //string required
"imgs": "" //string
Used to get all items assigned to specific owner
Gets the user by ID and it's credentials
Deletes user by ID