zjffdu commented on a change in pull request #4134:
URL: https://github.com/apache/zeppelin/pull/4134#discussion_r666787809



##########
File path: 
zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
##########
@@ -1007,20 +1017,29 @@ public void updatePersonalizedMode(String noteId,
   public void moveNoteToTrash(String noteId,
                               ServiceContext context,
                               ServiceCallback<Note> callback) throws 
IOException {
-    Note note = notebook.getNote(noteId);
-    if (note == null) {
-      callback.onFailure(new NoteNotFoundException(noteId), context);
+    if (!checkPermission(noteId, Permission.OWNER, 
Message.OP.MOVE_NOTE_TO_TRASH, context, callback)) {
       return;
     }
 
-    if (!checkPermission(noteId, Permission.OWNER, 
Message.OP.MOVE_NOTE_TO_TRASH, context,
-        callback)) {
-      return;
-    }
-    String destNotePath = "/" + NoteManager.TRASH_FOLDER + note.getPath();
+    String destNotePath = "/" + NoteManager.TRASH_FOLDER + 
notebook.getNoteManager().getNotesInfo().get(noteId);

Review comment:
       Why changing `note.getPath()`to 
`notebook.getNoteManager().getNotesInfo().get(noteId)`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to