aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/HighlightTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-05 16:18:33 +0800
committercrupest <crupest@outlook.com>2021-05-05 16:18:33 +0800
commit7d54e0b8b7ca84488fdcba90c68169a85b4d45c6 (patch)
treecf2fa58eef25e5bf871d8a71b15ac6694e357b54 /BackEnd/Timeline/Controllers/HighlightTimelineController.cs
parent51e1205d3a9c72a5734a842536630cea69359107 (diff)
downloadtimeline-7d54e0b8b7ca84488fdcba90c68169a85b4d45c6.tar.gz
timeline-7d54e0b8b7ca84488fdcba90c68169a85b4d45c6.tar.bz2
timeline-7d54e0b8b7ca84488fdcba90c68169a85b4d45c6.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/HighlightTimelineController.cs13
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();
}
}
}