File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
- import { fetchGraphQl } from '@dropins/tools/fetch-graphql.js' ;
1
+ import { fetchGraphQl , setFetchGraphQlHeaders } from '@dropins/tools/fetch-graphql.js' ;
2
+ import { getHeaders } from '../../scripts/configs.js' ;
2
3
3
4
export const getActiveRules = async ( cartId ) => {
4
5
try {
6
+ setFetchGraphQlHeaders ( await getHeaders ( 'cart' ) ) ;
5
7
const response = await fetchGraphQl (
6
8
`query CUSTOMER_SEGMENTS($cartId: String!){
7
9
customerSegments(cartId: $cartId) {
@@ -46,6 +48,7 @@ export const getCatalogPriceRules = async (sku) => {
46
48
}
47
49
}
48
50
` ;
51
+ setFetchGraphQlHeaders ( await getHeaders ( 'cart' ) ) ;
49
52
const response = await fetchGraphQl (
50
53
query ,
51
54
{
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const updateTargetedBlocksVisibility = async () => {
15
15
cart : {
16
16
rules : [ ] ,
17
17
} ,
18
+ catalogPriceRules : [ ] ,
18
19
} : await getActiveRules ( Cart . getCartDataFromCache ( ) . id ) ;
19
20
20
21
// eslint-disable-next-line no-underscore-dangle
You can’t perform that action at this time.
0 commit comments