Class: LegalPageService
services/legal_page.LegalPageService
1. Import the service from our library:
import {LegalPageService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getLegalPages` will return the paginated list of legal pages.
async getLegalPages() {
return await LegalPageService.getLegalPages();
}
In case of required `params`, just add them inside the brackets.
async getSpecificLegalPage(legalPageId) {
return await LegalPageService.getSpecificLegalPage(legalPageId);
}
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 LegalPageService(): LegalPageService
Returns
Methods
ackLegalPage
▸ ackLegalPage(id
, accept?
, config?
): Promise
<SCLegalPageAckType
>
Parameters
Name | Type |
---|---|
id | string | number |
accept? | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageAckType
>
Defined in
services/legal_page/index.ts:164
getAllLastRevisionsOfLegalPages
▸ getAllLastRevisionsOfLegalPages(config?
): Promise
<SCLegalPageType
[]>
Parameters
Name | Type |
---|---|
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageType
[]>
Defined in
services/legal_page/index.ts:152
getAllRevisionsOfLegalPage
▸ getAllRevisionsOfLegalPage(policy
, config?
): Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Parameters
Name | Type |
---|---|
policy | string |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Defined in
services/legal_page/index.ts:148
getLastRevisionOfLegalPage
▸ getLastRevisionOfLegalPage(policy
, config?
): Promise
<SCLegalPageType
>
Parameters
Name | Type |
---|---|
policy | string |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageType
>
Defined in
services/legal_page/index.ts:156
getLegalPages
▸ getLegalPages(params?
, config?
): Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Parameters
Name | Type |
---|---|
params? | LegalPageFilterParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Defined in
services/legal_page/index.ts:140
getSpecificLegalPage
▸ getSpecificLegalPage(id
, config?
): Promise
<SCLegalPageType
>
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageType
>
Defined in
services/legal_page/index.ts:144
getSpecificUserAck
▸ getSpecificUserAck(id
, config?
): Promise
<SCLegalPageAckType
>
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageAckType
>
Defined in
services/legal_page/index.ts:168
searchLegalPages
▸ searchLegalPages(params?
, config?
): Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Parameters
Name | Type |
---|---|
params? | LegalPageFilterParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCLegalPageType
>>
Defined in
services/legal_page/index.ts:160
userAckList
▸ userAckList(config?
): Promise
<SCLegalPageAckType
[]>
Parameters
Name | Type |
---|---|
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCLegalPageAckType
[]>