updateCustomListResponse method

Future<Response> updateCustomListResponse(
  1. String sessionToken,
  2. String listId,
  3. String listName,
  4. Visibility visibility,
  5. List<String> mangaIds,
  6. int version,
)
inherited

Endpoint used: PUT /list/{id}

Updates an existing custom list identified by its listId or UUID only if the user identified by the sessionToken has permission to update the list and returns the updated data in a http response.

Implementation

Future<http.Response> updateCustomListResponse(
    String sessionToken,
    String listId,
    String listName,
    Visibility visibility,
    List<String> mangaIds,
    int version) async {
  var payload = {
    HttpHeaders.authorizationHeader: 'Bearer $sessionToken',
    HttpHeaders.contentTypeHeader: 'application/json',
  };
  var body = {
    'name': listName,
    'visibility': EnumUtils.parseVisibilityFromEnum(visibility),
    'manga': mangaIds,
    'version': version,
  };
  var unencodedPath = '/list';
  final uri = 'https://$AUTHORITY$unencodedPath';
  return await http.put(Uri.parse(uri), headers: payload, body: body);
}