import 'package:taafee_mobile/features/favorite/data_layer/model/favorite.dart';

import '../../../../core/apis/apis.dart';
import '../../../../core/network/http.dart';

class FavoriteService {
  Future<List<FavoriteModel>> getFavorites(
      {void Function(Object)? onConnectionError}) async {
    Request request = Request(
      EndPoint.favorite,
      RequestMethod.get,
      cacheable: true,
      authorized: true,
    );
    Map<String, dynamic> response =
        await request.sendRequest(onConnectionError: onConnectionError);
    return FavoriteModel.fromJsonList(response);
  }
}
