|
@@ -167,11 +167,11 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpPut("shift")]
|
|
|
public async Task Update([FromBody] ShiftUpdateDto dto)
|
|
|
{
|
|
|
- var user = await _schedulingShiftRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
- if (user is null)
|
|
|
+ var shift = await _schedulingShiftRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
+ if (shift is null)
|
|
|
throw UserFriendlyException.SameMessage("无效班次信息");
|
|
|
- _mapper.Map(dto, user);
|
|
|
- await _schedulingShiftRepository.UpdateAsync(user, HttpContext.RequestAborted);
|
|
|
+ _mapper.Map(dto, shift);
|
|
|
+ await _schedulingShiftRepository.UpdateAsync(shift, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
|