Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit a87da0f

Browse files
committed
Make "params" argument optional in getter methods
1 parent d04da2e commit a87da0f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class Storyblok {
222222

223223
public get(
224224
slug: string,
225-
params?: ISbStoriesParams,
225+
params: ISbStoriesParams = {},
226226
fetchOptions?: ISbCustomFetch
227227
): Promise<ISbResult> {
228228
if (!params) params = {} as ISbStoriesParams
@@ -236,7 +236,7 @@ class Storyblok {
236236

237237
public async getAll(
238238
slug: string,
239-
params: ISbStoriesParams,
239+
params: ISbStoriesParams = {},
240240
entity?: string,
241241
fetchOptions?: ISbCustomFetch
242242
): Promise<any[]> {
@@ -265,7 +265,7 @@ class Storyblok {
265265

266266
public post(
267267
slug: string,
268-
params: ISbStoriesParams | ISbContentMangmntAPI,
268+
params: ISbStoriesParams | ISbContentMangmntAPI = {},
269269
fetchOptions?: ISbCustomFetch
270270
): Promise<ISbResponseData> {
271271
const url = `/${slug}`
@@ -277,7 +277,7 @@ class Storyblok {
277277

278278
public put(
279279
slug: string,
280-
params: ISbStoriesParams | ISbContentMangmntAPI,
280+
params: ISbStoriesParams | ISbContentMangmntAPI = {},
281281
fetchOptions?: ISbCustomFetch
282282
): Promise<ISbResponseData> {
283283
const url = `/${slug}`
@@ -289,7 +289,7 @@ class Storyblok {
289289

290290
public delete(
291291
slug: string,
292-
params: ISbStoriesParams | ISbContentMangmntAPI,
292+
params: ISbStoriesParams | ISbContentMangmntAPI = {},
293293
fetchOptions?: ISbCustomFetch
294294
): Promise<ISbResponseData> {
295295
const url = `/${slug}`
@@ -300,7 +300,7 @@ class Storyblok {
300300
}
301301

302302
public getStories(
303-
params: ISbStoriesParams,
303+
params: ISbStoriesParams = {},
304304
fetchOptions?: ISbCustomFetch
305305
): Promise<ISbStories> {
306306
this.client.setFetchOptions(fetchOptions)
@@ -311,7 +311,7 @@ class Storyblok {
311311

312312
public getStory(
313313
slug: string,
314-
params: ISbStoryParams,
314+
params: ISbStoryParams = {},
315315
fetchOptions?: ISbCustomFetch
316316
): Promise<ISbStory> {
317317
this.client.setFetchOptions(fetchOptions)

0 commit comments

Comments
 (0)