public async Task <ActionResult> UpdateSheriff(SheriffDto sheriffDto) { var sheriff = sheriffDto.Adapt <Sheriff>(); sheriff = await _service.UpdateSheriff(sheriff); return(Ok(sheriff.Adapt <SheriffDto>())); }
public async Task <ActionResult <SheriffDto> > UpdateSheriff(SheriffDto sheriffDto) { await CheckForAccessToSheriffByLocation(sheriffDto.Id); var sheriff = sheriffDto.Adapt <Sheriff>(); sheriff = await SheriffService.UpdateSheriff(sheriff); return(Ok(sheriff.Adapt <SheriffDto>())); }
public async Task <ActionResult <SheriffDto> > UpdateSheriff(SheriffWithIdirDto updateSheriff) { await CheckForAccessToSheriffByLocation(updateSheriff.Id); var canEditIdir = User.HasPermission(Permission.EditIdir); var sheriff = updateSheriff.Adapt <Sheriff>(); sheriff = await SheriffService.UpdateSheriff(sheriff, canEditIdir); return(Ok(sheriff.Adapt <SheriffDto>())); }