田爽 1 gadu atpakaļ
vecāks
revīzija
981dc2f3cb
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      src/Hotline.Api/Controllers/SchedulingController.cs

+ 4 - 0
src/Hotline.Api/Controllers/SchedulingController.cs

@@ -303,7 +303,11 @@ namespace Hotline.Api.Controllers
 			var scheduling = await _schedulingRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
 			if (scheduling is null)
 				throw UserFriendlyException.SameMessage("无效排班信息");
+			var shift = await _schedulingShiftRepository.GetAsync(dto.ShiftId, HttpContext.RequestAborted);
+			if (shift == null)
+				throw UserFriendlyException.SameMessage("传入排班班次信息错误");
 			_mapper.Map(dto, scheduling);
+			scheduling.ShiftName = shift.Name;
 			await _schedulingRepository.UpdateAsync(scheduling, HttpContext.RequestAborted);
 		}