Class: FeedObjectService
services/feed_object.FeedObjectService
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
Methods
checkIfFollowingFeedObject
▸ checkIfFollowingFeedObject(type
, id
, config?
): Promise
<SCFeedObjectFollowingStatusType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectFollowingStatusType
>
Defined in
services/feed_object/index.ts:777
checkIfSuspendedFeedObject
▸ checkIfSuspendedFeedObject(type
, id
, config?
): Promise
<SCFeedObjectSuspendedStatusType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectSuspendedStatusType
>
Defined in
services/feed_object/index.ts:793
createFeedObject
▸ createFeedObject(type
, data
, config?
): Promise
<SCFeedObjectType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
data | FeedObjCreateParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectType
>
Defined in
services/feed_object/index.ts:651
deleteFeedObject
▸ deleteFeedObject(type
, id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:676
feedObjectContributorsList
▸ feedObjectContributorsList(type
, id
, params?
, config?
): Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Defined in
services/feed_object/index.ts:684
feedObjectFlagList
▸ feedObjectFlagList(type
, id
, config?
): Promise
<SCPaginatedResponse
<SCFlagType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFlagType
>>
Defined in
services/feed_object/index.ts:817
feedObjectFlagStatus
▸ feedObjectFlagStatus(type
, id
, config?
): Promise
<SCPaginatedResponse
<SCFlagType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFlagType
>>
Defined in
services/feed_object/index.ts:825
feedObjectFollowingList
▸ feedObjectFollowingList(type
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:769
feedObjectHideStatus
▸ feedObjectHideStatus(type
, id
, config?
): Promise
<SCFeedObjectHideStatusType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectHideStatusType
>
Defined in
services/feed_object/index.ts:840
feedObjectPollVote
▸ feedObjectPollVote(type
, id
, choice
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
choice | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:743
feedObjectPollVotesList
▸ feedObjectPollVotesList(type
, id
, params?
, config?
): Promise
<SCPaginatedResponse
<SCPollVoteType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | FeedObjectPollVotesSearch |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCPollVoteType
>>
Defined in
services/feed_object/index.ts:752
feedObjectSharesList
▸ feedObjectSharesList(type
, id
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:693
feedObjectSuspendedList
▸ feedObjectSuspendedList(type
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:800
feedObjectUserSharesList
▸ feedObjectUserSharesList(type
, id
, params?
): Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | BaseGetParams |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Defined in
services/feed_object/index.ts:702
feedObjectVotes
▸ feedObjectVotes(type
, id
, params?
, config?
): Promise
<SCPaginatedResponse
<SCVoteType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCVoteType
>>
Defined in
services/feed_object/index.ts:735
flagFeedObject
▸ flagFeedObject(type
, id
, flag_type
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
flag_type | SCFlagTypeEnum |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:808
followFeedObject
▸ followFeedObject(type
, id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:761
getAllFeedObjects
▸ getAllFeedObjects(type
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
params? | FeedObjGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:627
getSpecificFeedObject
▸ getSpecificFeedObject(type
, id
, config?
): Promise
<SCFeedObjectType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectType
>
Defined in
services/feed_object/index.ts:659
getUncommentedFeedObjects
▸ getUncommentedFeedObjects(type
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:635
hideFeedObject
▸ hideFeedObject(type
, id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:832
relatedFeedObjects
▸ relatedFeedObjects(type
, id
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
params? | BaseGetParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:718
restoreFeedObject
▸ restoreFeedObject(type
, id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:710
searchFeedObject
▸ searchFeedObject(type
, params?
, config?
): Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
params? | BaseSearchParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCFeedObjectType
>>
Defined in
services/feed_object/index.ts:643
suspendFeedObject
▸ suspendFeedObject(type
, id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/feed_object/index.ts:785
updateFeedObject
▸ updateFeedObject(type
, id
, data
, config?
): Promise
<SCFeedObjectType
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
data | FeedObjCreateParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCFeedObjectType
>
Defined in
services/feed_object/index.ts:667
voteFeedObject
▸ voteFeedObject(type
, id
, reaction?
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
type | DISCUSSION | POST | STATUS |
id | string | number |
reaction? | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>