add fixes

This commit is contained in:
arsalan 2024-01-24 17:40:20 +05:30
parent 3cd5c4c471
commit b5c28dd288
3 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,6 @@ Authorization: {{auth-token}}
{
"name": "arsalan",
"msme": "1234",
"hsnCode": "1234",
"gstNumber": "GST123",
"address": "Bangalore",
"rating": 2,

View File

@ -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"))))

View File

@ -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) {