forked from MDCPS/DamageAssessment_Backend
Fix for Data seed issue,Url Correction for SurveyResponses
This commit is contained in:
@ -4,7 +4,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DamageAssesment.Api.Locations.Controllers
|
||||
{
|
||||
//[Route("api")]
|
||||
[Route("Locations")]
|
||||
//[Route("[controller]")]
|
||||
[ApiController]
|
||||
public class LocationsController : ControllerBase
|
||||
{
|
||||
@ -18,7 +19,8 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Get all locations.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Locations")]
|
||||
//[HttpGet("locations")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetLocationsAsync()
|
||||
{
|
||||
|
||||
@ -34,7 +36,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Get all locations based on locationdId.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Locations/{id}")]
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult> GetLocationByIdAsync(string id)
|
||||
{
|
||||
|
||||
@ -50,12 +52,12 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Update a Location.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Locations")]
|
||||
public async Task<IActionResult> UpdateLocation(Models.Location Location)
|
||||
[HttpPut("{locations}")]
|
||||
public async Task<IActionResult> UpdateLocation(Models.Location location)
|
||||
{
|
||||
if (Location != null)
|
||||
if (location != null)
|
||||
{
|
||||
var result = await this.LocationProvider.UpdateLocationAsync(Location);
|
||||
var result = await this.LocationProvider.UpdateLocationAsync(location);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return Ok(result.ErrorMessage);
|
||||
@ -68,7 +70,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Save a new location.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Locations")]
|
||||
[HttpPost("{locations}")]
|
||||
public async Task<IActionResult> CreateLocation(Models.Location Location)
|
||||
{
|
||||
if (Location != null)
|
||||
@ -86,7 +88,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Delete an existing location.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Locations/{id}")]
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<IActionResult> DeleteLocation(string id)
|
||||
{
|
||||
var result = await this.LocationProvider.DeleteLocationAsync(id);
|
||||
|
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace DamageAssesment.Api.Locations.Controllers
|
||||
{
|
||||
//[Route("api/[controller]")]
|
||||
[Route("[controller]")]
|
||||
[ApiController]
|
||||
public class RegionsController : ControllerBase
|
||||
{
|
||||
@ -45,7 +46,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// POST request for creating a new region.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost]
|
||||
[HttpPost("{region}")]
|
||||
public async Task<ActionResult> PostRegionAsync(Models.Region region)
|
||||
{
|
||||
var result = await this.regionProvider.PostRegionAsync(region);
|
||||
@ -59,7 +60,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// PUT request for updating an existing region.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut]
|
||||
[HttpPut("{region}")]
|
||||
public async Task<ActionResult> PutRegionAsync(Models.Region region)
|
||||
{
|
||||
var result = await this.regionProvider.PutRegionAsync(region);
|
||||
|
Reference in New Issue
Block a user