ModerationService
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
Methods
getAllFlaggedContributions()
static
getAllFlaggedContributions(params
?,config
?):Promise
<SCPaginatedResponse
<SCFlaggedContributionType
>>
Parameters
Parameter | Type |
---|---|
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
Parameter | Type |
---|---|
id | string | number |
contribution_type | SCContributionType |
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
Parameter | Type |
---|---|
id | string | number |
contribution_type | SCContributionType |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCContributionStatus
>
Source
services/moderation/index.ts:198
getUsersForModeration()
static
getUsersForModeration(params
?,config
?):Promise
<SCPaginatedResponse
<SCUserModerationType
>>
Parameters
Parameter | Type |
---|---|
params ? | ModerationParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserModerationType
>>
Source
services/moderation/index.ts:169
moderateAContribution()
static
moderateAContribution(id
,data
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
data | ModerateContributionParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
services/moderation/index.ts:195
moderateASpecificUser()
static
moderateASpecificUser(id
,status
,days_blocked
?,hard
?,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
id | string | number |
status | SCUserStatus |
days_blocked ? | string |
hard ? | number |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>