Skip to main content

ModerationService

Moderation service can be used in the following way:
1. Import the service from our library:

import {ModerationService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getUsersForModeration` will return the paginated list of users to moderate.

async getUsersForModeration() {
return await ModerationService.getUsersForModeration();
}
In case of required `params`, just add them inside the brackets.

async moderateASpecificUser(userId, userStatus) {
return await ModerationService.moderateASpecificUser(userId, userStatus);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

1. Declare it(or declare them, it is possible to add multiple params)

const headers = headers: {Authorization: `Bearer ${yourToken}`}

2. Add it inside the brackets and pass it to the function, as shown in the previous example!

Constructors

new ModerationService()

new ModerationService(): ModerationService

Returns

ModerationService

Methods

getAllFlaggedContributions()

static getAllFlaggedContributions(params?, config?): Promise <SCPaginatedResponse<SCFlaggedContributionType>>

Parameters

ParameterType
params?FlaggedContributionParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCFlaggedContributionType>>

Source

services/moderation/index.ts:181


getAllFlagsForSpecificContribution()

static getAllFlagsForSpecificContribution(id, contribution_type, flag_type?, config?): Promise <SCPaginatedResponse<SCFlagType>>

Parameters

ParameterType
idstring | number
contribution_typeSCContributionType
flag_type?SCFlagTypeEnum
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCFlagType>>

Source

services/moderation/index.ts:187


getContributionModerationStatus()

static getContributionModerationStatus(id, contribution_type, config?): Promise<SCContributionStatus>

Parameters

ParameterType
idstring | number
contribution_typeSCContributionType
config?AxiosRequestConfig<any>

Returns

Promise<SCContributionStatus>

Source

services/moderation/index.ts:198


getUsersForModeration()

static getUsersForModeration(params?, config?): Promise <SCPaginatedResponse<SCUserModerationType>>

Parameters

ParameterType
params?ModerationParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserModerationType>>

Source

services/moderation/index.ts:169


moderateAContribution()

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

Parameters

ParameterType
idstring | number
dataModerateContributionParams
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/moderation/index.ts:195


moderateASpecificUser()

static moderateASpecificUser(id, status, days_blocked?, hard?, config?): Promise<any>

Parameters

ParameterType
idstring | number
statusSCUserStatus
days_blocked?string
hard?number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/moderation/index.ts:172