diff --git a/src/main/java/org/ntlab/acanthus_server/resources/gallery/InvitesRest.java b/src/main/java/org/ntlab/acanthus_server/resources/gallery/InvitesRest.java index c932056..8de0c7f 100644 --- a/src/main/java/org/ntlab/acanthus_server/resources/gallery/InvitesRest.java +++ b/src/main/java/org/ntlab/acanthus_server/resources/gallery/InvitesRest.java @@ -75,12 +75,13 @@ @Produces(MediaType.APPLICATION_JSON) public String addInvite(@PathParam("aid") Integer aid, @FormParam("ownerUid") String ownerUid, @FormParam("invitedUid") String invitedUid, @FormParam("ownerToken") String ownerToken) { Animation animation = animations.getAnimationByAid(aid); - Account owner = animation.getOwner(); - //トークンの確認 + if (owner != null && owner.getToken().equals(ownerToken)) { animation.addAccoutToAnimationInvites(aid, ownerUid, invitedUid); - //accountのinvitedカラム(workカラム?)に追加する処理をかく + //↓矢印Workのstatusを招待状態にする処理 + Account account = accounts.getAccountByUid(Integer.parseInt(invitedUid)); + account.getWorkHashMap().get(aid).setInvites(); return "追加しました"; } else { throw new WebApplicationException(404); @@ -108,7 +109,6 @@ Account invitedAccount = accounts.getAccountByUid(Integer.parseInt(invitedUid)); if (invitedAccount != null && invitedAccount.getToken().equals(invitedToken)) { animation.deleteAccountFromAnimationInvites(aid, invitedUid); - return "削除しました"; } else { throw new WebApplicationException(404);