File tree Expand file tree Collapse file tree
backend/services/bigcommerce/customers
src/pages/api/store/display-settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import BigBaseApi from "../big-base-api" ;
2+ import { SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME , SUBSCRIPTION_IDS_ATTRIBUTE_NAME } from "@/shared/constants/bigcommerce" ;
23
34/**
45 * Customer API
@@ -97,16 +98,16 @@ export default class CustomersApi extends BigBaseApi {
9798 */
9899 public async getExistingCustomerAttributeNameIds ( ) {
99100 const attributeNameSearchResults = await this . client . get (
100- `${ this . baseUri } /attributes?name=${ process . env . SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME } `
101+ `${ this . baseUri } /attributes?name=${ SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME } `
101102 ) ;
102103 const attributeNameSearchResults2 = await this . client . get (
103- `${ this . baseUri } /attributes?name=${ process . env . SUBSCRIPTION_IDS_ATTRIBUTE_NAME } `
104+ `${ this . baseUri } /attributes?name=${ SUBSCRIPTION_IDS_ATTRIBUTE_NAME } `
104105 ) ;
105106
106107 return {
107- [ process . env . SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME ] :
108+ [ SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME ] :
108109 attributeNameSearchResults . data [ 0 ] ?. id ,
109- [ process . env . SUBSCRIPTION_IDS_ATTRIBUTE_NAME ] :
110+ [ SUBSCRIPTION_IDS_ATTRIBUTE_NAME ] :
110111 attributeNameSearchResults2 . data [ 0 ] ?. id
111112 } ;
112113 }
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import { DisplaySettingPayload } from "@/shared/payloads/DisplaySettingPayload";
77import HttpStatus from "http-status-codes" ;
88import { appContainer } from "@/shared/di-container/app" ;
99import { injectable } from "tsyringe" ;
10- import { STOREFRONT_CONTENT_MODE } from "@/constants/bigcommerce" ;
11-
10+ import { STOREFRONT_CONTENT_MODE , SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME , SUBSCRIPTION_IDS_ATTRIBUTE_NAME } from "@/constants/bigcommerce" ;
1211@injectable ( )
1312export class DisplaySettingController extends BaseBigCommerceController {
1413 public requiresAuth = true ;
@@ -121,9 +120,9 @@ export class DisplaySettingController extends BaseBigCommerceController {
121120 await this . bigApi . customers . upsertInitialCustomerAttributes ( ) ;
122121 const customerAttributesUpdate = {
123122 customerAttributeFieldId :
124- customerAttributeIds [ process . env . SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME ] ,
123+ customerAttributeIds [ SUBSCRIPTION_CUSTOMER_ATTRIBUTE_NAME ] ,
125124 subscriptionsAttributeFieldId :
126- customerAttributeIds [ process . env . SUBSCRIPTION_IDS_ATTRIBUTE_NAME ]
125+ customerAttributeIds [ SUBSCRIPTION_IDS_ATTRIBUTE_NAME ]
127126 } ;
128127
129128 // Update store record with secure store URL and the script or widget ids from the upsert process above
You can’t perform that action at this time.
0 commit comments