getShortInfoBySlug method

Future<Map> getShortInfoBySlug(
  1. String slug
)

Implementation

Future<Map> getShortInfoBySlug(String slug) async {
  try {
    final response = await _dio.get('/manga-short-info?slug=$slug');
    return response.data;
  } on DioException catch (e) {
    if (e.response!.statusCode == 400) {
      throw Exception("Bad slug! Media not found!");
    } else {
      throw Exception("An error has occurred");
    }
  }
}