editComment method

  1. @Deprecated('user commentEdit()')
Future<ApiComment> editComment({
  1. dynamic content = '',
  2. List<ApiFile>? files,
  3. required ApiPost post,
  4. ApiComment? parent,
  5. ApiComment? comment,
})

Implementation

@Deprecated('user commentEdit()')
Future<ApiComment> editComment({
  content = '',
  List<ApiFile>? files,
  required ApiPost post,
  ApiComment? parent,
  ApiComment? comment,
}) async {
  final data = {
    'route': 'forum.editComment',
    'comment_post_ID': post.idx,
    // if (comment != null && comment.commentId != null && comment.commentId != '')
    //   'comment_ID': comment.commentId,
    // if (parent != null) 'comment_parent': parent.commentId,
    // 'comment_content': content ?? '',
  };
  if (files != null) {
    Set ids = files.map((file) => file.idx).toSet();
    data['files'] = ids.join(',');
  }
  final json = await request(data);
  return ApiComment.fromJson(json);
}