diff --git a/src/main/java/org/ntlab/acanthus_server/entities/Animation.java b/src/main/java/org/ntlab/acanthus_server/entities/Animation.java index f9120df..91ab975 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Animation.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Animation.java @@ -127,6 +127,20 @@ invites.remove(invitedAccount); } + + //----------------------------------------------------------------- + //gallery/aid/editorsのPUTの中身の処理 + public void restWorkToEditors(Integer aid, Integer Uid) { + Account account = accounts.getAccountByUid(Uid); + Animation animation = gallery.getAnimationByAid(aid); + + Editor editor = new Editor(account, false); + editor.setAccount(account); + animation.addEditors(editor); + animation.removeAnimationInvites(account); + } + + //----------------------------------------------------------------- //----------------------------------------------------------------- // ダミー diff --git a/src/main/java/org/ntlab/acanthus_server/resources/gallery/EditorsRest.java b/src/main/java/org/ntlab/acanthus_server/resources/gallery/EditorsRest.java index 2b01bee..3a3b6cd 100644 --- a/src/main/java/org/ntlab/acanthus_server/resources/gallery/EditorsRest.java +++ b/src/main/java/org/ntlab/acanthus_server/resources/gallery/EditorsRest.java @@ -44,13 +44,8 @@ //招待された時のみの追加 var account = accounts.getAccountByUid(uid); var animation = gallery.getAnimationInformation(aid); - Editor editor = new Editor(account, false); if (account != null && animation != null && account.getToken().equals(token)) { - editor.setAccount(account); - animation.addEditors(editor); - if(!editor.checkOwner()){ - animation.removeAnimationInvites(account); - } + animation.restWorkToEditors(aid, uid); } else { //ユーザーID、トークンが間違っている時のレスポンス throw new WebApplicationException(401);