Skip to content

Commit

Permalink
Bookmarks: Handle failed scenarios for create/update/delete operations
Browse files Browse the repository at this point in the history
(reference #30)
  • Loading branch information
piotrzarzycki21 committed Aug 9, 2023
1 parent 7c993a8 commit 3867b92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ package mediator.bookmarks
this.updateListOfBookmarks();
this.bookmarksProxy.selectedBookmark = null;
break;
case ProxyBookmarks.NOTE_BOOKMARK_DELETE_FAILED:
sendNotification(ApplicationConstants.COMMAND_SHOW_POPUP, new PopupVO(PopupType.ERROR, this.getMediatorName(), String(note.getBody())));
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ package mediator.bookmarks
import org.puremvc.as3.multicore.patterns.mediator.Mediator;

import view.bookmarks.event.BookmarkEvent;
import constants.PopupType;
import model.vo.PopupVO;

public class MediatorEditBookmark extends Mediator implements IMediator
{
Expand Down Expand Up @@ -70,16 +72,17 @@ package mediator.bookmarks
{
case ProxyBookmarks.NOTE_BOOKMARK_CREATE_SUCCESS:
this.bookmarksProxy.getCustomBookmarksList();
break;
case ProxyBookmarks.NOTE_BOOKMARK_CREATE_FAILED:

break;
case ProxyBookmarks.NOTE_BOOKMARK_UPDATE_SUCCESS:
sendNotification(ApplicationConstants.NOTE_OPEN_SELECTED_BOOKMARK_GROUP, this.bookmarksProxy.selectedGroup);
break;
case ProxyBookmarks.NOTE_CUSTOM_BOOKMARKS_LIST_FETCHED:
sendNotification(ApplicationConstants.NOTE_OPEN_SELECTED_BOOKMARK_GROUP, this.bookmarksProxy.selectedGroup);
break;
case ProxyBookmarks.NOTE_BOOKMARK_CREATE_FAILED:
case ProxyBookmarks.NOTE_BOOKMARK_UPDATE_FAILED:
sendNotification(ApplicationConstants.COMMAND_SHOW_POPUP, new PopupVO(PopupType.ERROR, this.getMediatorName(), String(note.getBody())));
break;
}
}

Expand Down

0 comments on commit 3867b92

Please sign in to comment.