From 7d54e0b8b7ca84488fdcba90c68169a85b4d45c6 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 5 May 2021 16:18:33 +0800 Subject: refactor: ... --- BackEnd/Timeline/Controllers/HighlightTimelineController.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs') 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 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(); } } } -- cgit v1.2.3