Skip to main content

CommentApiClient

Contains all the endpoints needed to manage comments.

Constructors

new CommentApiClient()

new CommentApiClient(): CommentApiClient

Returns

CommentApiClient

Methods

createComment()

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

This endpoint creates a comment.

Parameters

ParameterTypeDescription
dataCommentCreateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Source

services/comment/index.ts:42


deleteComment()

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

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

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/comment/index.ts:70


flagComment()

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

This endpoint flags a specific comment.

Parameters

ParameterTypeDescription
idstring | number
flagTypeSCFlagTypeEnum
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/comment/index.ts:117


getASpecificComment()

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

This endpoint retrieves a specific comment using ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Source

services/comment/index.ts:51


getAllComments()

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

This endpoint retrieves all comments.

Parameters

ParameterTypeDescription
paramsCommentListParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCCommentType>>

Source

services/comment/index.ts:32


getSpecificCommentFlagStatus()

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

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

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCFlagType>

Source

services/comment/index.ts:126


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

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCFlagType>>

Source

services/comment/index.ts:107


getSpecificCommentVotesList()

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

This endpoint retrieves all votes for a specific comment.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCVoteType>>

Source

services/comment/index.ts:88


restoreComment()

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

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

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/comment/index.ts:79


updateComment()

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

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

Parameters

ParameterTypeDescription
idstring | number
textstring
config?AxiosRequestConfig<any>

Returns

Promise<SCCommentType>

Source

services/comment/index.ts:61


upvoteComment()

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

This endpoint upvotes a specific comment.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/comment/index.ts:97