Skip to content

Commit

Permalink
Fix Customer 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 8d357a7 commit 1ed4d59
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Grand.Api/Controllers/OData/CustomerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public async Task<IActionResult> Delete(string key)
}


//odata/Customer/AddAddress/(email)
//odata/Customer(email)/AddAddress
[SwaggerOperation(summary: "Invoke action AddAddress", OperationId = "AddAddress")]
[Route("[action]/({key}")]
[Route("({key}/[action]")]
[HttpPost]
public async Task<IActionResult> AddAddress(string key, [FromBody] AddressDto address)
{
Expand All @@ -116,9 +116,9 @@ public async Task<IActionResult> AddAddress(string key, [FromBody] AddressDto ad
return Ok(address);
}

//odata/Customer/UpdateAddress/(email)
//odata/Customer(email)/UpdateAddress
[SwaggerOperation(summary: "Invoke action UpdateAddress", OperationId = "UpdateAddress")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> UpdateAddress(string key, [FromBody] AddressDto address)
{
Expand All @@ -137,10 +137,10 @@ public async Task<IActionResult> UpdateAddress(string key, [FromBody] AddressDto
return Ok(address);
}

//odata/Customer/DeleteAddress/(email)
//odata/Customer(email)/DeleteAddress
//body: { "addressId": "xxx" }
[SwaggerOperation(summary: "Invoke action DeleteAddress", OperationId = "DeleteAddress")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> DeleteAddress(string key, [FromBody] ODataActionParameters parameters)
{
Expand All @@ -165,10 +165,10 @@ public async Task<IActionResult> DeleteAddress(string key, [FromBody] ODataActio
}


//odata/Customer/SetPassword/(email)
//odata/Customer(email)/SetPassword
//body: { "password": "123456" }
[SwaggerOperation(summary: "Invoke action SetPassword", OperationId = "SetPassword")]
[Route("[action]/({key})")]
[Route("({key})/[action]")]
[HttpPost]
public async Task<IActionResult> SetPassword(string key, [FromBody] ODataActionParameters parameters)
{
Expand Down

0 comments on commit 1ed4d59

Please sign in to comment.