diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java index ce744d4..20d1ad8 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java @@ -6,7 +6,9 @@ import org.ntlab.acanthus_client.Acanthus; import org.ntlab.acanthus_client.R; +import org.ntlab.acanthus_client.entities.Work; import org.ntlab.acanthus_client.resources.accounts.InvitedRest; +import org.ntlab.acanthus_client.resources.accounts.WorkRest; import retrofit2.Call; import retrofit2.Callback; @@ -19,7 +21,6 @@ // 招待されているかの問い合わせAPI public class InvitedConnectionModel { - private final String TAG = "InvitedConnectionModel"; private Retrofit retrofit; private Acanthus acanthus; @@ -32,7 +33,7 @@ //----------------------------------------------------------------- // 招待確認 - public void checkInvited(MutableLiveData mText) { + public void checkInvited(MutableLiveData mIsInvitedText) { final InvitedRest invitedRest = retrofit.create(InvitedRest.class); Call call = invitedRest.checkAccountInvited(acanthus.getPreferenceUid(), acanthus.getAid()); @@ -40,7 +41,7 @@ @Override public void onResponse(Call call, Response response) { if (response.isSuccessful()) - mText.setValue(response.body().toString()); + mIsInvitedText.setValue(response.body().toString()); } @Override @@ -52,6 +53,26 @@ } //----------------------------------------------------------------- + // 招待承認 + public void acceptInvite() { + final WorkRest workRest = retrofit.create(WorkRest.class); + + // 作品への参加 + Call call = workRest.updateWork(acanthus.getPreferenceUid(), acanthus.getPreferenceToken(), acanthus.getAid()); + call.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if (response.isSuccessful()) ; + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + } + + //----------------------------------------------------------------- //----------------------------------------------------------------- // init private void init(Acanthus acanthus) {