diff --git a/app/src/main/java/com/example/citrusclient/viewmodels/SettingsViewModel.java b/app/src/main/java/com/example/citrusclient/viewmodels/SettingsViewModel.java index a696254..64b850d 100644 --- a/app/src/main/java/com/example/citrusclient/viewmodels/SettingsViewModel.java +++ b/app/src/main/java/com/example/citrusclient/viewmodels/SettingsViewModel.java @@ -19,7 +19,8 @@ private final MutableLiveData error_changePw_LiveData; //アカウント削除時の通信レスポンス結果格納用 private final MutableLiveData error_deleteAccount_LiveData; - //アカウントID変更はやるのか不明なので一旦保留 + //アカウントID変更 + private final MutableLiveData error_changeAccount_LiveData; @@ -32,10 +33,12 @@ this.accountColorLiveData = new MutableLiveData<>(); this.error_changePw_LiveData = new MutableLiveData<>(); this.error_deleteAccount_LiveData = new MutableLiveData<>(); + this.error_changeAccount_LiveData = new MutableLiveData<>(); } public MutableLiveData getAccountColorLiveData(){return accountColorLiveData;} - public MutableLiveData getResponse_changePw(){return error_changePw_LiveData;} - public MutableLiveDatagetResponse_deleteAccount(){return error_deleteAccount_LiveData;} + public MutableLiveData getError_changePw_LiveData(){return error_changePw_LiveData;} + public MutableLiveData getError_deleteAccount_LiveData(){return error_deleteAccount_LiveData;} + public MutableLiveData getError_changeAccount_LiveData(){return error_changeAccount_LiveData;} public void loadAccountColor(String accountId){ Call call= accountsRest.getAccountColor(accountId); @@ -142,14 +145,17 @@ public void onResponse(Call call, Response response) { if(response.isSuccessful()){ System.out.println("success"); + error_changeAccount_LiveData.setValue(204); }else{ System.out.println("fail"); + error_changeAccount_LiveData.setValue(404); } } @Override public void onFailure(Call call, Throwable t) { System.out.println("NetWorkError"+t); + error_changeAccount_LiveData.setValue(404); } }); }