Returns json data about Admin.
-
URL
/register
-
Method:
POST
-
URL Params
Required:
NONE
-
Data Params
{ email: 'admin@mail.com, password: 123456 }
-
Success Response:
- Code: 201
Content:{ id : newUser.id, email : newUser.email, RoleId : newUser.RoleId }
- Code: 201
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ errors : ["Please Insert Email Correctly", "Please insert email", "Please insert password", "Please insert password minimum 6"] }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 400 BAD REQUEST
Returns json data about Admin.
-
URL
/login
-
Method:
POST
-
URL Params
Required:
NONE
-
Data Params
{ email: 'admin@mail.com, password: 123456 }
-
Success Response:
- Code: 200
Content:{ "token" : String }
- Code: 200
-
Error Response:
- Code: 404 DATA NOT FOUND
Content:{ error : "email / password invalid" }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 404 DATA NOT FOUND
Returns json data about User.
-
URL
/loginUser
-
Method:
POST
-
URL Params
Required:
NONE
-
Data Params
{ email: 'admin@mail.com, password: 123456 }
-
Success Response:
- Code: 200
Content:{ "token" : String }
- Code: 200
-
Error Response:
- Code: 404 DATA NOT FOUND
Content:{ error : "email / password invalid" }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 404 DATA NOT FOUND
Returns json data about User.
-
URL
/registerUser
-
Method:
POST
-
URL Params
Required:
NONE
-
Data Params
{ email: 'admin@mail.com, password: 123456 }
-
Success Response:
- Code: 201
Content:{ id : newUser.id, email : newUser.email, RoleId : newUser.RoleId }
- Code: 201
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ errors : ["Please Insert Email Correctly", "Please insert email", "Please insert password", "Please insert password minimum 6"] }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 400 BAD REQUEST
Returns json data about product.
-
URL
/products
-
Method:
POST
-
URL Params
Required:
NONE
-
Data Params
{ name : "meja", description: "meja bagus" url : "image.jpg", price: 12000, stock: 8 }
-
Headers Params
{ token: String }
-
Success Response:
- Code: 201
Content:{ message : "add success", id : data.id }
- Code: 201
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 400 BAD REQUEST
Returns array of json data about products.
-
URL
/products
-
Method:
GET
-
URL Params
Required:
NONE
-
Data Params
NONE
-
Success Response:
- Code: 200
Content:[ { id: 1 name : "meja", img_url : "image.jpg", price: 12000, stock: 8, description: "meja bagus" } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 500 INTERNAL SERVER ERROR
Returns json data about products.
-
URL
/products/:id
-
Method:
PUT
-
URL Params
Required:
{ id : 1 }
-
Data Params
{ id: 1 name : "Bottle Plastic", img_url : "image.jpg", price: 12000, stock: 8 }
-
Success Response:
- Code: 200
Content:{ message: "update success" }
- Code: 200
-
Error Response:
-
Code: 400 DATA NOT FOUND
Content:{ errors : ["Please insert Name for the Porduct", "Plese insert description to give infomation to the customer" ,"Please insert Price", "Please insert Price minimum 100 ", "Please insert The Quanty Product","Please insert Minimum quanty 1, Please insert Url_image] }
-
Code: 404 DATA NOT FOUND
Content:{ error : "Product not found" }
OR
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Delete Products
Returns json data about products.
-
URL
/products/:id
-
Method:
DELETE
-
URL Params
Required:
{ id : 1 }
-
Data Params
NONE
-
Success Response:
-
Code: 200
Content:{ message: "delete success" }
-
Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Returns json data about Cart.
-
Headers
{ token : 'string' }
-
URL
/cart/:id
-
Method:
DELETE
-
URL Params
Required:
{ id : 1 }
-
Data Params
NONE
-
Success Response:
-
Code: 200
Content:{ message: "delete success" }
-
Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Returns json data about cart.
-
URL
/cart
-
Method:
post
-
Headers
{ token : 'string' }
-
URL Params
Required:
{ id : 1 }
-
Data Params
NONE
-
Success Response:
-
Code: 200
Content:{ message: "success" }
-
Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Returns json data about cart.
-
URL
/cart/asc/:id
-
Headers
{ token : 'string' }
-
Method:
patch
-
URL Params
Required:
{ id : 1 }
-
Data Params
NONE
-
Success Response:
-
Code: 200
Content:{ message: "success" }
-
Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Returns json data about cart.
-
URL
/cart/asc/:id
-
Headers
{ token : 'string' }
-
Method:
patch
-
URL Params
Required:
{ id : 1 }
-
Data Params
NONE
-
Success Response:
-
Code: 200
Content:{ message: "success" }
-
Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
-
Returns array of json data about cart.
-
URL
/cart
-
Method:
GET
-
URL Params
**Required:**
Header: {
token: 'string'
}
-
Data Params
NONE
-
Success Response:
- Code: 200
Content:[ { UserId: 1 ProductionId : "meja", Status : "image.jpg", Stock: 12000, Production : { "data Product" } } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 500 INTERNAL SERVER ERROR
Find All Category
Returns array of json data about Category.
-
URL
/cart/category
-
Method:
GET
-
URL Params
**Required:**
`NONE`
-
Data Params
NONE
-
Success Response:
- Code: 200
Content:[ { Id: 1, name: "costume" } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 500 INTERNAL SERVER ERROR
Checkout cart
-
URL
/cart/checkout
-
Method:
GET
-
Headers
{
token : 'string'
}
- URL Params
**Required:**
```
{
UserId: req.CurrentId
}
```
-
Data Params
NONE
-
Success Response:
- Code: 200
Content:[ { message: 'success' } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 500 INTERNAL SERVER ERROR
-
URL
/Product/rate
-
Method:
GET
-
Headers
{
token : 'string'
}
- URL Params
**Required:**
```
{
ProductionId: 1
}
```
-
Data Params
{ rate: 4 }
-
Success Response:
- Code: 200
Content:[ { data: object } ]
- Code: 200
-
Error Response:
- Code: 500 INTERNAL SERVER ERROR
Content:{ error : "Internal Server Error" }
- Code: 500 INTERNAL SERVER ERROR