Skip to content

Commit cd5f773

Browse files
W-21241548: resolve conflicts
1 parent 8b3fc01 commit cd5f773

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

packages/commerce-sdk-react/src/hooks/ShopperBaskets/cache.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7-
import {ShopperBasketsV2Types, ShopperCustomers, ShopperCustomersTypes} from 'commerce-sdk-isomorphic'
7+
import {
8+
ShopperBasketsV2Types,
9+
ShopperCustomers,
10+
ShopperCustomersTypes
11+
} from 'commerce-sdk-isomorphic'
812
import {
913
ApiClients,
1014
Argument,

packages/commerce-sdk-react/src/hooks/ShopperBaskets/query.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export const useBasket = (
4040
// Parameters can be set in `apiOptions` or `client.clientConfig`;
4141
// we must merge them in order to generate the correct query key.
4242
const netOptions = omitNullableParameters(mergeOptions(client, apiOptions))
43-
const parameters = pickValidParams(netOptions.parameters, ShopperBasketsV2.paramKeys[methodName])
43+
const parameters = pickValidParams(
44+
netOptions.parameters,
45+
ShopperBasketsV2.paramKeys[methodName]
46+
)
4447
const queryKey = queryKeyHelpers[methodName].queryKey(netOptions.parameters)
4548
// We don't use `netOptions` here because we manipulate the options in `useQuery`.
4649
const method = async (options: Options) => await client[methodName](options)
@@ -82,7 +85,10 @@ export const usePaymentMethodsForBasket = (
8285
// Parameters can be set in `apiOptions` or `client.clientConfig`;
8386
// we must merge them in order to generate the correct query key.
8487
const netOptions = omitNullableParameters(mergeOptions(client, apiOptions))
85-
const parameters = pickValidParams(netOptions.parameters, ShopperBasketsV2.paramKeys[methodName])
88+
const parameters = pickValidParams(
89+
netOptions.parameters,
90+
ShopperBasketsV2.paramKeys[methodName]
91+
)
8692
const queryKey = queryKeyHelpers[methodName].queryKey(netOptions.parameters)
8793
// We don't use `netOptions` here because we manipulate the options in `useQuery`.
8894
const method = async (options: Options) => await client[methodName](options)
@@ -124,7 +130,10 @@ export const usePriceBooksForBasket = (
124130
// Parameters can be set in `apiOptions` or `client.clientConfig`;
125131
// we must merge them in order to generate the correct query key.
126132
const netOptions = omitNullableParameters(mergeOptions(client, apiOptions))
127-
const parameters = pickValidParams(netOptions.parameters, ShopperBasketsV2.paramKeys[methodName])
133+
const parameters = pickValidParams(
134+
netOptions.parameters,
135+
ShopperBasketsV2.paramKeys[methodName]
136+
)
128137
const queryKey = queryKeyHelpers[methodName].queryKey(netOptions.parameters)
129138
// We don't use `netOptions` here because we manipulate the options in `useQuery`.
130139
const method = async (options: Options) => await client[methodName](options)
@@ -166,7 +175,10 @@ export const useShippingMethodsForShipment = (
166175
// Parameters can be set in `apiOptions` or `client.clientConfig`;
167176
// we must merge them in order to generate the correct query key.
168177
const netOptions = omitNullableParameters(mergeOptions(client, apiOptions))
169-
const parameters = pickValidParams(netOptions.parameters, ShopperBasketsV2.paramKeys[methodName])
178+
const parameters = pickValidParams(
179+
netOptions.parameters,
180+
ShopperBasketsV2.paramKeys[methodName]
181+
)
170182
const queryKey = queryKeyHelpers[methodName].queryKey(netOptions.parameters)
171183
// We don't use `netOptions` here because we manipulate the options in `useQuery`.
172184
const method = async (options: Options) => await client[methodName](options)
@@ -208,7 +220,10 @@ export const useTaxesFromBasket = (
208220
// Parameters can be set in `apiOptions` or `client.clientConfig`;
209221
// we must merge them in order to generate the correct query key.
210222
const netOptions = omitNullableParameters(mergeOptions(client, apiOptions))
211-
const parameters = pickValidParams(netOptions.parameters, ShopperBasketsV2.paramKeys[methodName])
223+
const parameters = pickValidParams(
224+
netOptions.parameters,
225+
ShopperBasketsV2.paramKeys[methodName]
226+
)
212227
const queryKey = queryKeyHelpers[methodName].queryKey(netOptions.parameters)
213228
// We don't use `netOptions` here because we manipulate the options in `useQuery`.
214229
const method = async (options: Options) => await client[methodName](options)

packages/commerce-sdk-react/src/hooks/ShopperPayments/queryKeyHelpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export const getPaymentConfiguration: QueryKeyHelper<'getPaymentConfiguration'>
4141
queryKey: (params: Params<'getPaymentConfiguration'>) => {
4242
return [
4343
...getPaymentConfiguration.path(params),
44-
// pickValidParams returns the filtered parameters, TypeScript sees that zoneId
44+
// pickValidParams returns the filtered parameters, TypeScript sees that zoneId
4545
// could be string | null, and complains because null isn't allowed in the query key.
4646
// omitNullable removes null values from the parameters (zoneId is optional but NOT nullable)
47-
omitNullable(pickValidParams(params || {}, ShopperPayments.paramKeys.getPaymentConfiguration))
47+
omitNullable(
48+
pickValidParams(params || {}, ShopperPayments.paramKeys.getPaymentConfiguration)
49+
)
4850
]
4951
}
5052
}

0 commit comments

Comments
 (0)