markMultipleChaptersUnread method
- @Deprecated('Use markChapterReadOrUnRead() instead')
inherited
Marks multiple chapters in the list of chapterIds
or uuids as UNREAD
Implementation
@Deprecated('Use markChapterReadOrUnRead() instead')
Future<Result> markMultipleChaptersUnread(
String sessionToken, String mangaId, List<String> chapterIds) async {
var idList = [];
chapterIds.forEach((element) {
idList.add(element);
});
var payload = {
'chapterIdsRead': chapterIds.toString(),
HttpHeaders.contentTypeHeader: 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $sessionToken'
};
var unencodedPath = '/manga/$mangaId/unread';
final uri = 'https://$AUTHORITY$unencodedPath';
var response = await http.post(Uri.parse(uri), headers: payload);
try {
return Result.fromJson(jsonDecode(response.body));
} on Exception {
throw MangadexServerException(jsonDecode(response.body));
}
}