diff options
author | crupest <crupest@outlook.com> | 2021-05-05 16:18:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-05 16:18:33 +0800 |
commit | e110f4a41bd711192af28874f71f031a130f0b84 (patch) | |
tree | 08610c5476549edfbe8e9a2605b8876e026d89f5 /BackEnd/Timeline/Controllers/HighlightTimelineController.cs | |
parent | 2a4b59c05236028ed1dc8304327b1ef484a376db (diff) | |
download | timeline-e110f4a41bd711192af28874f71f031a130f0b84.tar.gz timeline-e110f4a41bd711192af28874f71f031a130f0b84.tar.bz2 timeline-e110f4a41bd711192af28874f71f031a130f0b84.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/HighlightTimelineController.cs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs index 24201126..127392db 100644 --- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs +++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs @@ -93,16 +93,9 @@ namespace Timeline.Controllers [ProducesResponseType(403)]
public async Task<ActionResult> Move([FromBody] HttpHighlightTimelineMoveRequest body)
{
- try
- {
- var timelineId = await _timelineService.GetTimelineIdByNameAsync(body.Timeline);
- await _service.MoveHighlightTimelineAsync(timelineId, body.NewPosition!.Value);
- return Ok();
- }
- catch (InvalidHighlightTimelineException)
- {
- return BadRequest(new CommonResponse(ErrorCodes.HighlightTimelineController.NonHighlight, "Can't move a non-highlight timeline."));
- }
+ var timelineId = await _timelineService.GetTimelineIdByNameAsync(body.Timeline);
+ await _service.MoveHighlightTimelineAsync(timelineId, body.NewPosition!.Value);
+ return OkWithCommonResponse();
}
}
}
|