SuggestionService
1. Import the service from our library:
import {SuggestionService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getCategorySuggestion` will return the paginated list of categories.
async getCategorySuggestion() {
         return await SuggestionService.getCategorySuggestion();
      }
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 SuggestionService():
SuggestionService
Returns
SuggestionService
Methods
getCategorySuggestion()
staticgetCategorySuggestion(params?,config?):Promise<SCPaginatedResponse<SCCategoryType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCCategoryType>>
getCourseSuggestion()
staticgetCourseSuggestion(params?,config?):Promise<SCPaginatedResponse<SCCourseType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCCourseType>>
getEventSuggestion()
staticgetEventSuggestion(params?,config?):Promise<SCPaginatedResponse<SCEventType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCEventType>>
getIncubatorSuggestion()
staticgetIncubatorSuggestion(params?,config?):Promise<SCPaginatedResponse<SCIncubatorType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCIncubatorType>>
getPollSuggestion()
staticgetPollSuggestion(params?,config?):Promise<SCPaginatedResponse<SCFeedObjectType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCFeedObjectType>>
getSearchSuggestion()
staticgetSearchSuggestion(search,params?,config?):Promise<SCPaginatedResponse<SCSuggestionType>>
Parameters
| Parameter | Type | 
|---|---|
| search | string | 
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCSuggestionType>>
getUserSuggestion()
staticgetUserSuggestion(params?,config?):Promise<SCPaginatedResponse<SCUserType>>
Parameters
| Parameter | Type | 
|---|---|
| params? | BaseGetParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCUserType>>