Skip to content

Commit

Permalink
Merge pull request #326 from spree/fix-products-show-new-options
Browse files Browse the repository at this point in the history
Fix the squashed form of products.show() method
  • Loading branch information
tniezg authored Jan 31, 2022
2 parents ba2f3c4 + d99a39f commit 5c822ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/endpoints/Products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default class Products extends Http {
*/
public async show(id: string, token: IToken, params: IProductsQuery): Promise<IProductResult>
public async show(...allArguments: any[]): Promise<IProductResult> {
const [positionalId, positionalToken = {}, positionalParams = {}] = allArguments
const [idOrOptions, positionalToken = {}, positionalParams = {}] = allArguments
const { id, token, params } = squashAndPreparePositionalArguments(
[{ id: positionalId }, positionalToken, positionalParams],
[typeof idOrOptions === 'object' ? idOrOptions : { id: idOrOptions }, positionalToken, positionalParams],
['id']
)

Expand Down

0 comments on commit 5c822ac

Please sign in to comment.