mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
fix favourites overwrite
This commit is contained in:
parent
30fcf687eb
commit
7c44dad05d
@ -21,7 +21,7 @@ public interface FavoriteDao {
|
||||
@Query("SELECT * FROM favorites WHERE query_text = :query and type = :type")
|
||||
Favorite findFavoriteByQueryAndType(String query, FavoriteType type);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
@Insert
|
||||
List<Long> insertFavorites(Favorite... favorites);
|
||||
|
||||
@Update
|
||||
|
@ -513,7 +513,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
@Override
|
||||
public void onDataNotAvailable() {
|
||||
favoriteRepository.insertOrUpdateFavorite(new Favorite(
|
||||
-1,
|
||||
0,
|
||||
hashtag.substring(1),
|
||||
FavoriteType.HASHTAG,
|
||||
hashtagModel.getName(),
|
||||
|
@ -499,7 +499,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
@Override
|
||||
public void onDataNotAvailable() {
|
||||
favoriteRepository.insertOrUpdateFavorite(new Favorite(
|
||||
-1,
|
||||
0,
|
||||
locationId,
|
||||
FavoriteType.LOCATION,
|
||||
locationModel.getName(),
|
||||
|
@ -623,7 +623,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
@Override
|
||||
public void onDataNotAvailable() {
|
||||
favoriteRepository.insertOrUpdateFavorite(new Favorite(
|
||||
-1,
|
||||
0,
|
||||
profileModel.getUsername(),
|
||||
FavoriteType.USER,
|
||||
profileModel.getName(),
|
||||
|
Loading…
Reference in New Issue
Block a user