Skip to content

Commit 52c3523

Browse files
committed
W-21432256 update query key cache for baskets v2
1 parent ccf6af6 commit 52c3523

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const cacheUpdateMatrix: CacheUpdateMatrix<Client> = {
183183
],
184184
remove: [
185185
// We want to fuzzy match all queryKeys with `basketId` in their path
186-
// [`/commerce-sdk-react,/organizations/,${organization},/baskets/,${basketId}`]
186+
// [`/commerce-sdk-react,/organizations/,${organization},/baskets/v2/,${basketId}`]
187187
{queryKey: getBasket.path(parameters)}
188188
]
189189
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export type QueryKeys = {
1616
'/commerce-sdk-react',
1717
'/organizations/',
1818
string | undefined,
19-
'/baskets/v2',
19+
'/baskets/v2/',
2020
string | undefined,
2121
Params<'getBasket'>
2222
]
2323
getPaymentMethodsForBasket: [
2424
'/commerce-sdk-react',
2525
'/organizations/',
2626
string | undefined,
27-
'/baskets/v2',
27+
'/baskets/v2/',
2828
string | undefined,
2929
'/payment-methods',
3030
Params<'getPaymentMethodsForBasket'>
@@ -33,7 +33,7 @@ export type QueryKeys = {
3333
'/commerce-sdk-react',
3434
'/organizations/',
3535
string | undefined,
36-
'/baskets/v2',
36+
'/baskets/v2/',
3737
string | undefined,
3838
'/price-books',
3939
Params<'getPriceBooksForBasket'>
@@ -42,7 +42,7 @@ export type QueryKeys = {
4242
'/commerce-sdk-react',
4343
'/organizations/',
4444
string | undefined,
45-
'/baskets/v2',
45+
'/baskets/v2/',
4646
string | undefined,
4747
'/shipments/',
4848
string | undefined,
@@ -53,7 +53,7 @@ export type QueryKeys = {
5353
'/commerce-sdk-react',
5454
'/organizations/',
5555
string | undefined,
56-
'/baskets/v2',
56+
'/baskets/v2/',
5757
string | undefined,
5858
'/taxes',
5959
Params<'getTaxesFromBasket'>
@@ -74,7 +74,7 @@ export const getBasket: QueryKeyHelper<'getBasket'> = {
7474
'/commerce-sdk-react',
7575
'/organizations/',
7676
params?.organizationId,
77-
'/baskets/v2',
77+
'/baskets/v2/',
7878
params?.basketId
7979
],
8080
queryKey: (params: Params<'getBasket'>) => {
@@ -90,7 +90,7 @@ export const getPaymentMethodsForBasket: QueryKeyHelper<'getPaymentMethodsForBas
9090
'/commerce-sdk-react',
9191
'/organizations/',
9292
params?.organizationId,
93-
'/baskets/v2',
93+
'/baskets/v2/',
9494
params?.basketId,
9595
'/payment-methods'
9696
],
@@ -107,7 +107,7 @@ export const getPriceBooksForBasket: QueryKeyHelper<'getPriceBooksForBasket'> =
107107
'/commerce-sdk-react',
108108
'/organizations/',
109109
params?.organizationId,
110-
'/baskets/v2',
110+
'/baskets/v2/',
111111
params?.basketId,
112112
'/price-books'
113113
],
@@ -124,7 +124,7 @@ export const getShippingMethodsForShipment: QueryKeyHelper<'getShippingMethodsFo
124124
'/commerce-sdk-react',
125125
'/organizations/',
126126
params?.organizationId,
127-
'/baskets/v2',
127+
'/baskets/v2/',
128128
params?.basketId,
129129
'/shipments/',
130130
params?.shipmentId,
@@ -143,7 +143,7 @@ export const getTaxesFromBasket: QueryKeyHelper<'getTaxesFromBasket'> = {
143143
'/commerce-sdk-react',
144144
'/organizations/',
145145
params?.organizationId,
146-
'/baskets/v2',
146+
'/baskets/v2/',
147147
params?.basketId,
148148
'/taxes'
149149
],

0 commit comments

Comments
 (0)