Esempio n. 1
0
        public async Task <ActionResult <ShiftDto> > ExpireShifts(List <int> ids)
        {
            var locationIds = await ShiftService.GetShiftsLocations(ids);

            if (locationIds.Count != 1)
            {
                return(BadRequest(CannotUpdateCrossLocationError));
            }
            if (!PermissionDataFiltersExtensions.HasAccessToLocation(User, Db, locationIds.First()))
            {
                return(Forbid());
            }

            await ShiftService.ExpireShiftsAndDutySlots(ids);

            return(NoContent());
        }