CommentRepositoryclass. Before calling any comment methods, you must ensure to import it.
Enum: [post, content]
like": 1 }
posttype comment is a comment that is intended for a regular post. A
contenttype comment on the other hand is intended for a content type post. A content type comment will automatically create a content post if the
referenceIddoes not exist yet.
referenceIdthat is managed by the client. The
referenceIdhas to be unique but can be any string.
referenceType- values can be
referenceId- id of the post/content that you want to add the comment
text- comment body
commentForId()method in order to get a single comment. You need to pass the
commentIdof the requested comment as the parameter.
parentIdparameter in a comment query, along with the
parentIdto make it appear under the parent.
flagmethod. The required parameter is the comment ID, which is a string.
unflagmethod. The required parameter is the comment ID, which is a string.
isFlaggedByMemethod checks if a comment has been flagged by the current user. The required parameter is the comment ID, which is a string.
editedAtDatewill be set to the current time. This allows you to provide UI to the user to inform the user of specific messages that have been edited, if needed. An optional completion block can be provided to notify you of operation success.
isDeletedflag is set to
CommentRepositoryprovides a convenient method to delete comments. In deleting a comment, you need to pass the
commentIdand a boolean parameter. Set the boolean parameter to
truefor hard delete and
falsefor soft delete.
falseby default which is just equivalent to a soft delete.
deleteCommentmethod returns a promise acknowledging the server's successful response. Use
awaitto receive the result. It will return
trueif the deletion is successful. Otherwise, it will return