removeMangaReadingStatus method

Future<Result> removeMangaReadingStatus(
  1. String sessionToken,
  2. String mangaId
)
inherited

Endpoint used: DELETE /manga/{id}/aggregate

remove the reading status for a certain manga If no reading status is supplied to it, the reading status is set as 'reading'

Implementation

Future<Result> removeMangaReadingStatus(
    String sessionToken, String mangaId) async {
  var statusString = '';
  var unencodedPath = '/manga/$mangaId/status';
  final uri = 'https://$AUTHORITY$unencodedPath';
  var response = await http.post(Uri.parse(uri), headers: {
    HttpHeaders.contentTypeHeader: 'application/json',
    HttpHeaders.authorizationHeader: 'Bearer $sessionToken',
    'status': '$statusString',
  });
  try {
    return Result.fromJson(jsonDecode(response.body));
  } on Exception {
    throw MangadexServerException(jsonDecode(response.body));
  }
}