コード例 #1
0
        public IActionResult Approve(int id, [FromQuery] int dayId)
        {
            // TODO: maybe return some boolean result
            ServiceResult result = PeriodService.ApprovePeriod(id);

            if (result.Result == Result.NotFound)
            {
                return(NotFound());
            }

            if (result.Result != Result.OK)
            {
                return(BadRequest());
            }

            bool dayApproved = SchoolDayService.IsDayApproved(dayId);

            return(Ok(new
            {
                periodApproved = true,
                dayApproved,
            }));
        }