Skip to main content

Class: CommentApiClient

services/comment.CommentApiClient

Contains all the endpoints needed to manage comments.

Constructors

constructor

new CommentApiClient(): CommentApiClient

Returns

CommentApiClient

Methods

createComment

createComment(data, config?): Promise<SCCommentType>

This endpoint creates a comment.

Parameters

NameType
dataCommentCreateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Defined in

services/comment/index.ts:42


deleteComment

deleteComment(id, config?): Promise<any>

This endpoint deletes a specific comment using ID. The logged user must be the comment creator.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/comment/index.ts:70


flagComment

flagComment(id, flagType, config?): Promise<any>

This endpoint flags a specific comment.

Parameters

NameType
idstring | number
flagTypeSCFlagTypeEnum
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/comment/index.ts:117


getASpecificComment

getASpecificComment(id, config?): Promise<SCCommentType>

This endpoint retrieves a specific comment using ID.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Defined in

services/comment/index.ts:51


getAllComments

getAllComments(params, config?): Promise<SCPaginatedResponse<SCCommentType>>

This endpoint retrieves all comments.

Parameters

NameType
paramsCommentListParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCCommentType>>

Defined in

services/comment/index.ts:32


getSpecificCommentFlagStatus

getSpecificCommentFlagStatus(id, config?): Promise<SCFlagType>

This endpoint retrieves, if exists, a flag for this contribute created by the user logged.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCFlagType>

Defined in

services/comment/index.ts:126


getSpecificCommentFlags

getSpecificCommentFlags(id, config?): Promise<SCPaginatedResponse<SCFlagType>>

This endpoint retrieves a List of Flags for a Specific Comment. This operation requires moderation role.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCFlagType>>

Defined in

services/comment/index.ts:107


getSpecificCommentVotesList

getSpecificCommentVotesList(id, config?): Promise<SCPaginatedResponse<SCVoteType>>

This endpoint retrieves all votes for a specific comment.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCVoteType>>

Defined in

services/comment/index.ts:88


restoreComment

restoreComment(id, config?): Promise<any>

This endpoint restores a specific comment using ID. The logged user must be the comment creator.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/comment/index.ts:79


updateComment

updateComment(id, text, config?): Promise<SCCommentType>

This endpoint updates a specific comment. The logged user must be the comment creator.

Parameters

NameType
idstring | number
textstring
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Defined in

services/comment/index.ts:61


upvoteComment

upvoteComment(id, config?): Promise<any>

This endpoint upvotes a specific comment.

Parameters

NameType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/comment/index.ts:97