diff --git a/app/src/main/java/com/example/nemophila/viewmodels/FriendViewModel.java b/app/src/main/java/com/example/nemophila/viewmodels/FriendViewModel.java index 6879337..58e6151 100644 --- a/app/src/main/java/com/example/nemophila/viewmodels/FriendViewModel.java +++ b/app/src/main/java/com/example/nemophila/viewmodels/FriendViewModel.java @@ -5,10 +5,13 @@ import com.example.nemophila.entities.Post; import com.example.nemophila.resources.AccountsRest; +import com.example.nemophila.resources.FriendsRest; import java.util.Collection; import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.jackson.JacksonConverterFactory; @@ -41,6 +44,22 @@ return requestedLiveData; } public MutableLiveData> getRequestingLiveData() { return requestingLiveData; } + public void searchFriend(String uid,String fid, String token) { - Call call = accountsRest.deleteAccount(uid, token); + Call call = friendsRest.putFriend (); + call.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if (response.isSuccessful()) { + System.out.println("Successful"); + } else { + System.out.println("ResponseError"); + } + } + @Override + public void onFailure(Call call, Throwable t) { + System.out.println(" NetworkError" + t); + } + }); + } }