Example #1
0
        public async Task <ActionResult <SheriffLeaveDto> > UpdateSheriffLeave(SheriffLeaveDto sheriffLeaveDto)
        {
            await CheckForAccessToSheriffByLocation <SheriffLeave>(sheriffLeaveDto.Id);

            var sheriffLeave        = sheriffLeaveDto.Adapt <SheriffLeave>();
            var updatedSheriffLeave = await SheriffService.UpdateSheriffLeave(sheriffLeave);

            return(Ok(updatedSheriffLeave.Adapt <SheriffLeaveDto>()));
        }
Example #2
0
        public async Task <ActionResult <SheriffLeaveDto> > UpdateSheriffLeave(SheriffLeaveDto sheriffLeaveDto, bool overrideConflicts = false)
        {
            await CheckForAccessToSheriffByLocation <SheriffLeave>(sheriffLeaveDto.Id);

            var sheriffLeave        = sheriffLeaveDto.Adapt <SheriffLeave>();
            var updatedSheriffLeave = await SheriffService.UpdateSheriffLeave(DutyRosterService, ShiftService, sheriffLeave, overrideConflicts);

            return(Ok(updatedSheriffLeave.Adapt <SheriffLeaveDto>()));
        }