Implementation
Future<MangaCheck> followManga(String token, String mangaId,
{ReadingStatus? status}) async {
var unencodedPath = '/manga/$mangaId/follow';
final uri = 'https://$authority$unencodedPath';
var response = await http.post(Uri.parse(uri), headers: {
HttpHeaders.contentTypeHeader: 'application/json',
HttpHeaders.authorizationHeader: 'Bearer $token'
});
try {
//set manga reading status by default
await setMangaReadingStatus(token, mangaId, status);
print(
'set reading status as \'${status != null ? status.toString() : 'reading'}\' for manga $mangaId');
} catch (e) {
print("couldn't set reading status for manga $mangaId");
}
return MangaCheck.fromJson(jsonDecode(response.body));
}