diff --git a/src/index.ts b/src/index.ts index a4749ee0..b96a53b1 100755 --- a/src/index.ts +++ b/src/index.ts @@ -225,10 +225,9 @@ class Storyblok { public get( slug: string, - params?: ISbStoriesParams, + params: ISbStoriesParams = {}, fetchOptions?: ISbCustomFetch ): Promise { - if (!params) params = {} as ISbStoriesParams const url = `/${slug}` const query = this.factoryParamOptions(url, params) @@ -237,7 +236,7 @@ class Storyblok { public async getAll( slug: string, - params: ISbStoriesParams, + params: ISbStoriesParams = {}, entity?: string, fetchOptions?: ISbCustomFetch ): Promise { @@ -270,7 +269,7 @@ class Storyblok { public post( slug: string, - params: ISbStoriesParams | ISbContentMangmntAPI, + params: ISbStoriesParams | ISbContentMangmntAPI = {}, fetchOptions?: ISbCustomFetch ): Promise { const url = `/${slug}` @@ -280,7 +279,7 @@ class Storyblok { public put( slug: string, - params: ISbStoriesParams | ISbContentMangmntAPI, + params: ISbStoriesParams | ISbContentMangmntAPI = {}, fetchOptions?: ISbCustomFetch ): Promise { const url = `/${slug}` @@ -290,7 +289,7 @@ class Storyblok { public delete( slug: string, - params: ISbStoriesParams | ISbContentMangmntAPI, + params: ISbStoriesParams | ISbContentMangmntAPI = {}, fetchOptions?: ISbCustomFetch ): Promise { const url = `/${slug}` @@ -299,7 +298,7 @@ class Storyblok { } public getStories( - params: ISbStoriesParams, + params: ISbStoriesParams = {}, fetchOptions?: ISbCustomFetch ): Promise { this._addResolveLevel(params) @@ -309,7 +308,7 @@ class Storyblok { public getStory( slug: string, - params: ISbStoryParams, + params: ISbStoryParams = {}, fetchOptions?: ISbCustomFetch ): Promise { this._addResolveLevel(params)