addReplyComment method
Implementation
Future<ReplyCommentModel?> addReplyComment(postComments, user, comment) {
Log(
logName: 'AddReplyComment',
className: 'Comment',
methodName: 'addReplyComment',
type: 'INFO',
text:
'{event: Add Reply Comment, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, post id: $postComments, comment: $comment',
);
return _httpService
.addReplyComment(
postComments: postComments, user: user, comment: comment)
.then((data) async {
if (data.statusCode >= 200 && data.statusCode < 300) {
List<dynamic> res = json.decode(data.body);
ReplyCommentModel replyComment = ReplyCommentModel.fromJson(res[0]);
if (replyComment != null) return replyComment;
return null;
}
return null;
});
}