createBlogPost method

Future<BlogPost> createBlogPost(
  1. String title,
  2. String slug,
  3. int? headerImageId,
  4. int categoryId,
  5. bool public,
)

Creates a new blog post with the given data

Implementation

Future<BlogPost> createBlogPost(
  String title,
  String slug,
  int? headerImageId,
  int categoryId,
  bool public,
) async {
  final response = await _post('/api/blog/post', data: {
    'title': title,
    'slug': slug,
    'headerImageId': headerImageId,
    'categoryId': categoryId,
    'public': public,
  });

  return BlogPost.fromJson(response.data);
}