Class: CommentApiClient
services/comment.CommentApiClient
Contains all the endpoints needed to manage comments.
Constructors
constructor
• new CommentApiClient(): CommentApiClient
Returns
Methods
createComment
▸ createComment(data
, config?
): Promise
<SCCommentType
>
This endpoint creates a comment.
Parameters
Name | Type |
---|---|
data | CommentCreateParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCCommentType
>
Defined in
deleteComment
▸ deleteComment(id
, config?
): Promise
<any
>
This endpoint deletes a specific comment using ID. The logged user must be the comment creator.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
flagComment
▸ flagComment(id
, flagType
, config?
): Promise
<any
>
This endpoint flags a specific comment.
Parameters
Name | Type |
---|---|
id | string | number |
flagType | SCFlagTypeEnum |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
getASpecificComment
▸ getASpecificComment(id
, config?
): Promise
<SCCommentType
>
This endpoint retrieves a specific comment using ID.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCCommentType
>
Defined in
getAllComments
▸ getAllComments(params
, config?
): Promise
<SCPaginatedResponse
<SCCommentType
>>
This endpoint retrieves all comments.
Parameters
Name | Type |
---|---|
params | CommentListParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCCommentType
>>
Defined in
getSpecificCommentFlagStatus
▸ getSpecificCommentFlagStatus(id
, config?
): Promise
<SCFlagType
>
This endpoint retrieves, if exists, a flag for this contribute created by the user logged.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFlagType
>
Defined in
getSpecificCommentFlags
▸ getSpecificCommentFlags(id
, config?
): Promise
<SCPaginatedResponse
<SCFlagType
>>
This endpoint retrieves a List of Flags for a Specific Comment. This operation requires moderation role.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFlagType
>>
Defined in
getSpecificCommentVotesList
▸ getSpecificCommentVotesList(id
, config?
): Promise
<SCPaginatedResponse
<SCVoteType
>>
This endpoint retrieves all votes for a specific comment.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCVoteType
>>
Defined in
restoreComment
▸ restoreComment(id
, config?
): Promise
<any
>
This endpoint restores a specific comment using ID. The logged user must be the comment creator.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
updateComment
▸ updateComment(id
, text
, config?
): Promise
<SCCommentType
>
This endpoint updates a specific comment. The logged user must be the comment creator.
Parameters
Name | Type |
---|---|
id | string | number |
text | string |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCCommentType
>
Defined in
upvoteComment
▸ upvoteComment(id
, config?
): Promise
<any
>
This endpoint upvotes a specific comment.
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>