public async Task <ActionResult <SheriffAwayLocationDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto) { var sheriffLeave = sheriffLeaveDto.Adapt <SheriffLeave>(); var createdSheriffLeave = await _service.AddSheriffLeave(sheriffLeave); return(Ok(createdSheriffLeave)); }
public async Task <ActionResult <SheriffLeaveDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto) { await CheckForAccessToSheriffByLocation(sheriffLeaveDto.SheriffId); var sheriffLeave = sheriffLeaveDto.Adapt <SheriffLeave>(); var createdSheriffLeave = await SheriffService.AddSheriffLeave(sheriffLeave); return(Ok(createdSheriffLeave.Adapt <SheriffLeaveDto>())); }
public async Task <ActionResult <SheriffLeaveDto> > AddSheriffLeave(SheriffLeaveDto sheriffLeaveDto, bool overrideConflicts = false) { await CheckForAccessToSheriffByLocation(sheriffLeaveDto.SheriffId); var sheriffLeave = sheriffLeaveDto.Adapt <SheriffLeave>(); var createdSheriffLeave = await SheriffService.AddSheriffLeave(DutyRosterService, ShiftService, sheriffLeave, overrideConflicts); return(Ok(createdSheriffLeave.Adapt <SheriffLeaveDto>())); }