Show list favorite from api

This commit is contained in:
Nezumi
2023-03-03 11:52:37 +07:00
parent 498459696a
commit a9b0ea500b
4 changed files with 111 additions and 17 deletions
@@ -12,7 +12,10 @@ import java.util.List;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
@@ -55,4 +58,13 @@ public interface FoodApi {
@GET("district")
Call<List<DistrictWardResponse>> districtResponse();
@GET("wishlist")
Call<List<Food>> getListFavoriteFood();
@POST("wishlist")
Call<Food> addFoodToFavorite(@Body Food food);
@DELETE("wishlist/{id}")
Call<Food> removeFoodFromFavorite(@Path("id") int id);
}