diff --git a/packages/client/src/builders/search/searchConstraintBuilder.ts b/packages/client/src/builders/search/searchConstraintBuilder.ts index ab5eec8..fb1944d 100644 --- a/packages/client/src/builders/search/searchConstraintBuilder.ts +++ b/packages/client/src/builders/search/searchConstraintBuilder.ts @@ -4,10 +4,12 @@ export class SearchConstraintBuilder { private resultConstraint: ProductSearchResultConstraint | null = null; public setResultMustHaveVariantConstraint(constaint: { exceptWhenProductHasNoVariants: boolean }): this { - this.resultConstraint = { + const constraint: ResultMustHaveVariantConstraint = { $type: 'Relewise.Client.Requests.Search.Settings.ResultMustHaveVariantConstraint, Relewise.Client', ...constaint, - } as ResultMustHaveVariantConstraint; + }; + + this.resultConstraint = constraint; return this; }