check in the file for delete and trim string.
This commit is contained in:
@@ -22,8 +22,7 @@ namespace CarParkValidationAPI.Controllers
|
||||
|
||||
public ConcessionValidationController(IConcessionValidation concessionValidation,
|
||||
ConcessionValidationReportRepository concesionReportReport)
|
||||
{
|
||||
|
||||
{
|
||||
_concessionValidationReport = concesionReportReport;
|
||||
_concessionValidation = concessionValidation;
|
||||
}
|
||||
@@ -76,13 +75,12 @@ namespace CarParkValidationAPI.Controllers
|
||||
}
|
||||
[HttpDelete("{id:int}")]
|
||||
public async Task<IActionResult> DeleteConcessionValidation(int id)
|
||||
{
|
||||
|
||||
{
|
||||
// only admins can access other user records
|
||||
var currentUser = (User)HttpContext.Items["User"];
|
||||
//if (id != currentUser.Id && currentUser.Role != Role.Admin)
|
||||
if (null == currentUser)
|
||||
return Unauthorized(new { message = "Unauthorized" });
|
||||
//
|
||||
_concessionValidation.SetCurrentUser(currentUser.Username);
|
||||
var retval = await _concessionValidation.DeleteConcessionValidationAsync(id);
|
||||
return Ok(retval);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user