add fixes
This commit is contained in:
parent
3cd5c4c471
commit
b5c28dd288
1
api.http
1
api.http
@ -141,7 +141,6 @@ Authorization: {{auth-token}}
|
||||
{
|
||||
"name": "arsalan",
|
||||
"msme": "1234",
|
||||
"hsnCode": "1234",
|
||||
"gstNumber": "GST123",
|
||||
"address": "Bangalore",
|
||||
"rating": 2,
|
||||
|
||||
@ -139,7 +139,7 @@ fun main(args: Array<String>) {
|
||||
delete("/{id}", QuotationCtrl::delete, Roles(Role.Explicit(listOf("ROLE_QUOTE_CREATE", "ROLE_ADMIN"))))
|
||||
}
|
||||
path("/product"){
|
||||
post("", ProductCtrl::create, Roles(Role.Explicit(listOf("ROLE_PRODUCT_CREATE", "ROLE_ADMIN"))))
|
||||
post("", ProductCtrl::create, Roles(Role.Explicit(listOf("ROLE_PRODUCT_CREATE", "ROLE_ADMIN", "ROLE_VENDOR_CREATE"))))
|
||||
//get("/{hsnCode}", ProductCtrl::get, Roles(Role.Explicit(listOf("ROLE_PRODUCT_VIEW", "ROLE_ADMIN"))))
|
||||
put("/{id}", ProductCtrl::update, Roles(Role.Explicit(listOf("ROLE_PRODUCT_UPDATE", "ROLE_ADMIN"))))
|
||||
//patch("/{id}", ProductCtrl::patch, Roles(Role.Explicit(listOf("ROLE_PRODUCT_UPDATE", "ROLE_ADMIN"))))
|
||||
|
||||
@ -456,6 +456,7 @@ object ProductCtrl {
|
||||
fun create(ctx :Context){
|
||||
val product = ctx.bodyAsClass<Product>()
|
||||
database.save(product)
|
||||
ctx.json(product).status(HttpStatus.CREATED)
|
||||
}
|
||||
|
||||
fun delete(ctx: Context) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user