@longvansoftware/storefront-js-client 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/lib/SDK.d.ts
CHANGED
package/dist/src/lib/SDK.js
CHANGED
|
@@ -68,5 +68,18 @@ class SDK {
|
|
|
68
68
|
this.paymentV2.setStoreId(storeId);
|
|
69
69
|
// Set storeId for other services here
|
|
70
70
|
}
|
|
71
|
+
setOrgId(orgId) {
|
|
72
|
+
this.orgId = orgId;
|
|
73
|
+
this.product.setOrgId(orgId);
|
|
74
|
+
this.auth.setOrgId(orgId);
|
|
75
|
+
this.order.setOrgId(orgId);
|
|
76
|
+
this.user.setOrgId(orgId);
|
|
77
|
+
this.payment.setOrgId(orgId);
|
|
78
|
+
this.crm.setOrgId(orgId);
|
|
79
|
+
this.service.setOrgId(orgId);
|
|
80
|
+
this.warehouse.setOrgId(orgId);
|
|
81
|
+
this.image.setOrgId(orgId);
|
|
82
|
+
this.paymentV2.setOrgId(orgId);
|
|
83
|
+
}
|
|
71
84
|
}
|
|
72
85
|
exports.SDK = SDK;
|
|
@@ -9,6 +9,7 @@ export declare class Service {
|
|
|
9
9
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
10
10
|
setToken(token: string): void;
|
|
11
11
|
setStoreId(storeId: string): void;
|
|
12
|
+
setOrgId(orgId: string): void;
|
|
12
13
|
protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
|
|
13
14
|
protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
|
|
14
15
|
protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
|
|
@@ -40,6 +40,9 @@ class Service {
|
|
|
40
40
|
setStoreId(storeId) {
|
|
41
41
|
this.storeId = storeId;
|
|
42
42
|
}
|
|
43
|
+
setOrgId(orgId) {
|
|
44
|
+
this.orgId = orgId;
|
|
45
|
+
}
|
|
43
46
|
graphqlQuery(query, variables) {
|
|
44
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
48
|
try {
|
|
@@ -195,7 +198,7 @@ class Service {
|
|
|
195
198
|
method: "POST",
|
|
196
199
|
headers: {
|
|
197
200
|
"Content-Type": "application/json",
|
|
198
|
-
// PartnerId: this.orgId, -> payment bị thừa partnerId -> lỗi
|
|
201
|
+
// PartnerId: this.orgId, -> payment bị thừa partnerId -> lỗi
|
|
199
202
|
Authorization: "Bearer " + this.token,
|
|
200
203
|
},
|
|
201
204
|
},
|