diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs index c0bb7d4a..867f295f 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs @@ -24,18 +24,6 @@ public BookmarkController(IBookmarkService bookmarkService) this.bookmarkService = bookmarkService; } - /// - /// - /// Gets all bookmarks by parent. - /// - /// Bookmarks. - [HttpGet] - [Route("GetAllByParent")] - public async Task> GetAllByParent() - { - return await this.bookmarkService.GetAllByParent(this.TokenWithoutBearer); - } - /// /// The GetAllByParent. /// @@ -43,14 +31,21 @@ public async Task> GetAllByParent() /// The all. /// The . [HttpGet] + [Route("GetAllByParent")] [Route("GetAllByParent/{parentId?}")] public async Task GetAllByParent(int? parentId, bool? all = false) { - var bookmarks = await this.bookmarkService.GetAllByParent(this.CurrentUserId.GetValueOrDefault(), parentId, all); - return this.Ok(bookmarks); + if (this.CurrentUserId.GetValueOrDefault() != null) + { + var bookmarks = await this.bookmarkService.GetAllByParent(this.CurrentUserId.GetValueOrDefault(), parentId, all); + return this.Ok(bookmarks); + } + else + { + return this.Ok(await this.bookmarkService.GetAllByParent(this.TokenWithoutBearer)); + } } - /// /// The Create. ///