update method

Future<void> update(
  1. String stylesheet, {
  2. String? reason,
})

Update the stylesheet for the Subreddit.

stylesheet is the CSS for the new stylesheet.

Implementation

Future<void> update(String stylesheet, {String? reason}) async {
  final uri = apiPath['subreddit_stylesheet']
      .replaceAll(SubredditRef._subredditRegExp, _subreddit.displayName);

  final data = <String, String?>{
    'api_type': 'json',
    'op': 'save',
    'reason': reason,
    'stylesheet_contents': stylesheet,
  };

  return await _subreddit.reddit.post(uri, data);
}