CommentApiClient
Contains all the endpoints needed to manage comments.
Constructors
Constructor
new CommentApiClient():
CommentApiClient
Returns
CommentApiClient
Methods
createComment()
staticcreateComment(data,config?):Promise<SCCommentType>
This endpoint creates a comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | CommentCreateParams | |
config? | AxiosRequestConfig |
Returns
Promise<SCCommentType>
deleteComment()
staticdeleteComment(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 |
Returns
Promise<any>
flagComment()
staticflagComment(id,flagType,config?):Promise<any>
This endpoint flags a specific comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
flagType | SCFlagTypeEnum | |
config? | AxiosRequestConfig |
Returns
Promise<any>
getAllComments()
staticgetAllComments(params,config?):Promise<SCPaginatedResponse<SCCommentType>>
This endpoint retrieves all comments.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CommentListParams | |
config? | AxiosRequestConfig |
Returns
Promise<SCPaginatedResponse<SCCommentType>>
getASpecificComment()
staticgetASpecificComment(id,config?):Promise<SCCommentType>
This endpoint retrieves a specific comment using ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise<SCCommentType>
getSpecificCommentFlags()
staticgetSpecificCommentFlags(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 |
Returns
Promise<SCPaginatedResponse<SCFlagType>>
getSpecificCommentFlagStatus()
staticgetSpecificCommentFlagStatus(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 |
Returns
Promise<SCFlagType>
getSpecificCommentVotesList()
staticgetSpecificCommentVotesList(id,config?):Promise<SCPaginatedResponse<SCVoteType>>
This endpoint retrieves all votes for a specific comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise<SCPaginatedResponse<SCVoteType>>
restoreComment()
staticrestoreComment(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 |
Returns
Promise<any>
updateComment()
staticupdateComment(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 |
Returns
Promise<SCCommentType>
upvoteComment()
staticupvoteComment(id,config?):Promise<any>
This endpoint upvotes a specific comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise<any>