Skip to main content

FeedObjectService

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

import {FeedObjectService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getAllFeedObjects` will return the paginated list of feed objs.

async getAllFeedObjects(type) {
return await FeedObjectService.getAllFeedObjects(type);
}
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

Constructor

new FeedObjectService(): FeedObjectService

Returns

FeedObjectService

Methods

checkIfFollowingFeedObject()

static checkIfFollowingFeedObject(type, id, config?): Promise<SCFeedObjectFollowingStatusType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectFollowingStatusType>


checkIfSuspendedFeedObject()

static checkIfSuspendedFeedObject(type, id, config?): Promise<SCFeedObjectSuspendedStatusType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectSuspendedStatusType>


createFeedObject()

static createFeedObject(type, data, config?): Promise<SCFeedObjectType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
dataFeedObjCreateParams
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectType>


deleteFeedObject()

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

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


feedObjectContributorsList()

static feedObjectContributorsList(type, id, params?, config?): Promise<SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCUserType>>


feedObjectFlagList()

static feedObjectFlagList(type, id, config?): Promise<SCPaginatedResponse<SCFlagType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFlagType>>


feedObjectFlagStatus()

static feedObjectFlagStatus(type, id, config?): Promise<SCPaginatedResponse<SCFlagType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFlagType>>


feedObjectFollowingList()

static feedObjectFollowingList(type, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


feedObjectHideStatus()

static feedObjectHideStatus(type, id, config?): Promise<SCFeedObjectHideStatusType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectHideStatusType>


feedObjectPollVote()

static feedObjectPollVote(type, id, choice, config?): Promise<any>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
choicenumber
config?AxiosRequestConfig

Returns

Promise<any>


feedObjectPollVotesList()

static feedObjectPollVotesList(type, id, params?, config?): Promise<SCPaginatedResponse<SCPollVoteType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?FeedObjectPollVotesSearch
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCPollVoteType>>


feedObjectSharesList()

static feedObjectSharesList(type, id, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


feedObjectSuspendedList()

static feedObjectSuspendedList(type, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


feedObjectUserSharesList()

static feedObjectUserSharesList(type, id, params?): Promise<SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?BaseGetParams

Returns

Promise<SCPaginatedResponse<SCUserType>>


feedObjectVotes()

static feedObjectVotes(type, id, params?, config?): Promise<SCPaginatedResponse<SCVoteType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCVoteType>>


flagFeedObject()

static flagFeedObject(type, id, flag_type, config?): Promise<any>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
flag_typeSCFlagTypeEnum
config?AxiosRequestConfig

Returns

Promise<any>


followFeedObject()

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

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


getAllFeedObjects()

static getAllFeedObjects(type, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
params?FeedObjGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


getSpecificFeedObject()

static getSpecificFeedObject(type, id, config?): Promise<SCFeedObjectType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectType>


getUncommentedFeedObjects()

static getUncommentedFeedObjects(type, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


hideFeedObject()

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

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


relatedFeedObjects()

static relatedFeedObjects(type, id, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
params?BaseGetParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


restoreFeedObject()

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

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


searchFeedObject()

static searchFeedObject(type, params?, config?): Promise<SCPaginatedResponse<SCFeedObjectType>>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
params?BaseSearchParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCFeedObjectType>>


suspendFeedObject()

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

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
config?AxiosRequestConfig

Returns

Promise<any>


updateFeedObject()

static updateFeedObject(type, id, data, config?): Promise<SCFeedObjectType>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
dataFeedObjCreateParams
config?AxiosRequestConfig

Returns

Promise<SCFeedObjectType>


voteFeedObject()

static voteFeedObject(type, id, reaction?, config?): Promise<any>

Parameters

ParameterType
typeDISCUSSION | POST | STATUS
idstring | number
reaction?number
config?AxiosRequestConfig

Returns

Promise<any>