From e110f4a41bd711192af28874f71f031a130f0b84 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 5 May 2021 16:18:33 +0800 Subject: refactor: ... --- BackEnd/Timeline/Controllers/BookmarkTimelineController.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs') diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs index bfbf82f3..551a41e2 100644 --- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs +++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs @@ -92,16 +92,9 @@ namespace Timeline.Controllers [ProducesResponseType(401)] public async Task Move([FromBody] HttpBookmarkTimelineMoveRequest request) { - try - { - var timelineId = await _timelineService.GetTimelineIdByNameAsync(request.Timeline); - await _service.MoveBookmarkAsync(GetUserId(), timelineId, request.NewPosition!.Value); - return Ok(); - } - catch (InvalidBookmarkException) - { - return BadRequest(new CommonResponse(ErrorCodes.BookmarkTimelineController.NonBookmark, "You can't move a non-bookmark timeline.")); - } + var timelineId = await _timelineService.GetTimelineIdByNameAsync(request.Timeline); + await _service.MoveBookmarkAsync(GetUserId(), timelineId, request.NewPosition!.Value); + return OkWithCommonResponse(); } } } -- cgit v1.2.3