@longvansoftware/storefront-js-client 1.0.13 → 1.0.15
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
3
|
+
exports.GET_CUSTOMER_BY_ID = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetPersonByIds($partyIds: [String!]!) {
|
|
@@ -31,3 +31,20 @@ exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
|
+
exports.GET_CUSTOMER_BY_ID = (0, graphql_tag_1.gql) `
|
|
35
|
+
query GetCustomerById($id: String){
|
|
36
|
+
getCustomerById(id: $id) {
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
address
|
|
40
|
+
gender
|
|
41
|
+
identityNumber
|
|
42
|
+
birthDate
|
|
43
|
+
email
|
|
44
|
+
phone
|
|
45
|
+
createdStamp
|
|
46
|
+
createdBy
|
|
47
|
+
memberLevel
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
@@ -45,7 +45,7 @@ class CrmService extends service_1.Service {
|
|
|
45
45
|
};
|
|
46
46
|
try {
|
|
47
47
|
const response = yield this.graphqlQuery(query, variables);
|
|
48
|
-
return response.
|
|
48
|
+
return response.getListOpportunity;
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
51
|
console.log(`Error in getListOpportunity: ${error}`);
|
|
@@ -6,4 +6,5 @@ export declare class UserService extends Service {
|
|
|
6
6
|
createCompany(payload: createCompanyRequest, createdBy: string): Promise<any>;
|
|
7
7
|
updateCompanyInfo(id: string, fieldName: string, valueUpdate: string, updatedBy: string): Promise<any>;
|
|
8
8
|
updateCustomerV2(id: string, customerItem: updateCustomerRequest, updatedBy: string): Promise<any>;
|
|
9
|
+
getCustomerById(id: string): Promise<any>;
|
|
9
10
|
}
|
|
@@ -97,5 +97,21 @@ class UserService extends service_1.Service {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
getCustomerById(id) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const query = queries_1.GET_CUSTOMER_BY_ID;
|
|
103
|
+
const variables = {
|
|
104
|
+
id
|
|
105
|
+
};
|
|
106
|
+
try {
|
|
107
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
108
|
+
return response.getCustomerById;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
console.log(`Error in getCustomerById: ${error}`);
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
100
116
|
}
|
|
101
117
|
exports.UserService = UserService;
|
package/dist/src/types/crm.d.ts
CHANGED