Move bookmark container API endpoints to their own controller
This commit is contained in:
parent
b8b23abffc
commit
4623d8838d
5 changed files with 95 additions and 72 deletions
|
|
@ -51,7 +51,7 @@
|
|||
protected async void OnSubmit()
|
||||
{
|
||||
HttpResponseMessage response = await Http
|
||||
.PostAsJsonAsync("Bookmarks/CreateBookmarkContainer", model.Title);
|
||||
.PostAsJsonAsync("BookmarkContainers/Create", model.Title);
|
||||
|
||||
Stream stream = response.RequestMessage!.Content!.ReadAsStream();
|
||||
StreamReader reader = new StreamReader(stream);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
try
|
||||
{
|
||||
HttpResponseMessage result = await Http
|
||||
.DeleteAsync($"Bookmarks/DeleteBookmarkContainer/{this.BookmarkContainerId}");
|
||||
.DeleteAsync($"BookmarkContainers/Delete/{this.BookmarkContainerId}");
|
||||
|
||||
if (result.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -99,10 +99,11 @@ else
|
|||
|
||||
protected async Task LoadContainers()
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
this.bookmarkContainers = await Http
|
||||
.GetFromJsonAsync<IList<BookmarkContainerDto>>(
|
||||
"Bookmarks/GetAllBookmarkContainers");
|
||||
"BookmarkContainers");
|
||||
|
||||
if (this.bookmarkContainers == null || !this.bookmarkContainers.Any())
|
||||
{
|
||||
|
|
@ -111,7 +112,8 @@ else
|
|||
|
||||
await this.OnContainerSelected(await this.GetSelectedContainerId());
|
||||
}
|
||||
catch (AccessTokenNotAvailableException e) {
|
||||
catch (AccessTokenNotAvailableException e)
|
||||
{
|
||||
e.Redirect();
|
||||
}
|
||||
}
|
||||
|
|
@ -119,7 +121,7 @@ else
|
|||
protected async Task CreateDefaultContainer()
|
||||
{
|
||||
HttpResponseMessage response = await Http
|
||||
.PostAsJsonAsync("Bookmarks/CreateBookmarkContainer", "Default");
|
||||
.PostAsJsonAsync("BookmarkContainers/Create", "Default");
|
||||
|
||||
BookmarkContainerDto? container = await response
|
||||
.RequestMessage
|
||||
|
|
@ -139,7 +141,7 @@ else
|
|||
|
||||
BookmarkContainerDto? bookmarkContainer = await Http
|
||||
.GetFromJsonAsync<BookmarkContainerDto?>(
|
||||
$"Bookmarks/GetBookmarkContainer/{bookmarkContainerId}");
|
||||
$"BookmarkContainers/{bookmarkContainerId}");
|
||||
|
||||
await this.SetSelectedContainer(bookmarkContainerId);
|
||||
this.selectedBookmarkContainer = bookmarkContainer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue