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