From c5264679c3b3b69a97c3ce56ee088eb9ff6e7f4e Mon Sep 17 00:00:00 2001 From: Simon Walenkamp Hansen Date: Mon, 12 Aug 2024 11:50:16 +0200 Subject: [PATCH] Review comment --- .../client/src/builders/search/searchConstraintBuilder.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }