File tree Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change 1
- import { getSession } from './session' ;
2
- import { isEmpty } from 'lodash' ;
3
-
4
- export const getAddOrViewCartConfig = ( ) => {
5
-
6
- const config = {
7
- headers : {
8
- 'X-Headless-CMS' : true ,
9
- } ,
10
- }
11
-
12
- const storedSession = getSession ( ) ;
13
-
14
- if ( ! isEmpty ( storedSession ) ) {
15
- config . headers [ 'x-wc-session' ] = storedSession ;
16
- }
17
-
18
- return config ;
19
- }
Original file line number Diff line number Diff line change 1
- import { isEmpty } from 'lodash' ;
2
-
3
- export const storeSession = ( session ) => {
4
-
5
- if ( isEmpty ( session ) ) {
6
- return null ;
7
- }
8
-
9
- localStorage . setItem ( 'x-wc-session' , session ) ;
10
- }
11
-
12
- export const getSession = ( ) => {
13
- return localStorage . getItem ( 'x-wc-session' ) ;
14
- }
You can’t perform that action at this time.
0 commit comments