Skip to content

Commit 9928659

Browse files
committed
GetSectionParams added
1 parent 59e7eb0 commit 9928659

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @code.store/arcxp-sdk-ts
22

3+
## 4.43.1
4+
5+
### Patch Changes
6+
7+
- GetSectionParams added
8+
39
## 4.43.0
410

511
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code.store/arcxp-sdk-ts",
3-
"version": "4.43.0",
3+
"version": "4.43.1",
44
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
55
"type": "commonjs",
66
"main": "./dist/index.js",

src/api/site/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import type { Section, SetSection } from '../../types/section';
22
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
3-
import type { GetLinksParams, GetLinksResponse, GetSectionsResponse, Link, Website } from './types';
3+
import type { GetLinksParams, GetLinksResponse, GetSectionParams, GetSectionsResponse, Link, Website } from './types';
44

55
export class ArcSite extends ArcAbstractAPI {
66
constructor(options: ArcAPIOptions) {
77
super({ ...options, apiPath: 'site/v3' });
88
}
99

10-
async getSections(website: string, offset?: number) {
11-
const { data } = await this.client.get<GetSectionsResponse>(`/website/${website}/section`, {
12-
params: { _website: website, offset },
10+
async getSections(params: GetSectionParams) {
11+
const { data } = await this.client.get<GetSectionsResponse>(`/website/${params.website}/section`, {
12+
params: { _website: params.website, ...params },
1313
});
1414

1515
return data;

src/api/site/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ export type GetLinksParams = {
3434
export type GetLinksResponse = {
3535
q_results: Link[];
3636
};
37+
38+
export type GetSectionParams ={
39+
website: string;
40+
offset?: number;
41+
include_inactive?: boolean;
42+
}

0 commit comments

Comments
 (0)