Skip to content

Commit

Permalink
Fix Product Controller - Swagger - API Requests don't work when they …
Browse files Browse the repository at this point in the history
…have [FromBody] ODataActionParameters parameters #993
  • Loading branch information
PatrykPorabik committed Oct 28, 2020
1 parent 1ed4d59 commit c50b4e3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Grand.Api/Controllers/OData/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public async Task<IActionResult> Delete(string key)
//odata/Product(id)/UpdateStock
//body: { "Stock": 10 }
[SwaggerOperation(summary: "Invoke action UpdateStock", OperationId = "UpdateStock")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateStock(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -152,7 +152,7 @@ public async Task<IActionResult> UpdateStock(string key, [FromBody] ODataActionP
#region Product category

[SwaggerOperation(summary: "Invoke action CreateProductCategory", OperationId = "CreateProductCategory")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductCategory(string key, [FromBody] ProductCategoryDto productCategory)
{
Expand All @@ -179,7 +179,7 @@ public async Task<IActionResult> CreateProductCategory(string key, [FromBody] Pr
}

[SwaggerOperation(summary: "Invoke action UpdateProductCategory", OperationId = "UpdateProductCategory")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductCategory(string key, [FromBody] ProductCategoryDto productCategory)
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public async Task<IActionResult> UpdateProductCategory(string key, [FromBody] Pr
}

[SwaggerOperation(summary: "Invoke action DeleteProductCategory", OperationId = "DeleteProductCategory")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductCategory(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -244,7 +244,7 @@ public async Task<IActionResult> DeleteProductCategory(string key, [FromBody] OD
#region Product manufacturer

[SwaggerOperation(summary: "Invoke action CreateProductManufacturer", OperationId = "CreateProductManufacturer")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductManufacturer(string key, [FromBody] ProductManufacturerDto productManufacturer)
{
Expand Down Expand Up @@ -272,7 +272,7 @@ public async Task<IActionResult> CreateProductManufacturer(string key, [FromBody
}

[SwaggerOperation(summary: "Invoke action UpdateProductManufacturer", OperationId = "UpdateProductManufacturer")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductManufacturer(string key, [FromBody] ProductManufacturerDto productManufacturer)
{
Expand All @@ -299,7 +299,7 @@ public async Task<IActionResult> UpdateProductManufacturer(string key, [FromBody
}

[SwaggerOperation(summary: "Invoke action DeleteProductManufacturer", OperationId = "DeleteProductManufacturer")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductManufacturer(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -335,7 +335,7 @@ public async Task<IActionResult> DeleteProductManufacturer(string key, [FromBody
#region Product picture

[SwaggerOperation(summary: "Invoke action CreateProductPicture", OperationId = "CreateProductPicture")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductPicture(string key, [FromBody] ProductPictureDto productPicture)
{
Expand Down Expand Up @@ -363,7 +363,7 @@ public async Task<IActionResult> CreateProductPicture(string key, [FromBody] Pro
}

[SwaggerOperation(summary: "Invoke action UpdateProductPicture", OperationId = "UpdateProductPicture")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductPicture(string key, [FromBody] ProductPictureDto productPicture)
{
Expand Down Expand Up @@ -391,7 +391,7 @@ public async Task<IActionResult> UpdateProductPicture(string key, [FromBody] Pro
}

[SwaggerOperation(summary: "Invoke action DeleteProductPicture", OperationId = "DeleteProductPicture")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductPicture(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -428,7 +428,7 @@ public async Task<IActionResult> DeleteProductPicture(string key, [FromBody] ODa
#region Product specification

[SwaggerOperation(summary: "Invoke action CreateProductSpecification", OperationId = "CreateProductSpecification")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductSpecification(string key, [FromBody] ProductSpecificationAttributeDto productSpecification)
{
Expand All @@ -455,7 +455,7 @@ public async Task<IActionResult> CreateProductSpecification(string key, [FromBod
}

[SwaggerOperation(summary: "Invoke action UpdateProductSpecification", OperationId = "UpdateProductSpecification")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductSpecification(string key, [FromBody] ProductSpecificationAttributeDto productSpecification)
{
Expand All @@ -482,7 +482,7 @@ public async Task<IActionResult> UpdateProductSpecification(string key, [FromBod
}

[SwaggerOperation(summary: "Invoke action DeleteProductSpecification", OperationId = "DeleteProductSpecification")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductSpecification(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -519,7 +519,7 @@ public async Task<IActionResult> DeleteProductSpecification(string key, [FromBod
#region Product tierprice

[SwaggerOperation(summary: "Invoke action CreateProductTierPrice", OperationId = "CreateProductTierPrice")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductTierPrice(string key, [FromBody] ProductTierPriceDto productTierPrice)
{
Expand All @@ -546,7 +546,7 @@ public async Task<IActionResult> CreateProductTierPrice(string key, [FromBody] P
}

[SwaggerOperation(summary: "Invoke action UpdateProductTierPrice", OperationId = "UpdateProductTierPrice")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductTierPrice(string key, [FromBody] ProductTierPriceDto productTierPrice)
{
Expand All @@ -573,7 +573,7 @@ public async Task<IActionResult> UpdateProductTierPrice(string key, [FromBody] P
}

[SwaggerOperation(summary: "Invoke action DeleteProductTierPrice", OperationId = "DeleteProductTierPrice")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductTierPrice(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down Expand Up @@ -609,7 +609,7 @@ public async Task<IActionResult> DeleteProductTierPrice(string key, [FromBody] O
#region Product attribute mapping

[SwaggerOperation(summary: "Invoke action CreateProductAttributeMapping", OperationId = "CreateProductAttributeMapping")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> CreateProductAttributeMapping(string key, [FromBody] ProductAttributeMappingDto productAttributeMapping)
{
Expand All @@ -636,7 +636,7 @@ public async Task<IActionResult> CreateProductAttributeMapping(string key, [From
}

[SwaggerOperation(summary: "Invoke action UpdateProductAttributeMapping", OperationId = "UpdateProductAttributeMapping")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateProductAttributeMapping(string key, [FromBody] ProductAttributeMappingDto productAttributeMapping)
{
Expand All @@ -663,7 +663,7 @@ public async Task<IActionResult> UpdateProductAttributeMapping(string key, [From
}

[SwaggerOperation(summary: "Invoke action DeleteProductAttributeMapping", OperationId = "DeleteProductAttributeMapping")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteProductAttributeMapping(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down

0 comments on commit c50b4e3

Please sign in to comment.