@longvansoftware/storefront-js-client 1.0.20 → 1.1.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_CUSTOMER_BY_ID = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
3
|
+
exports.SEARCH_COMPANY = 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!]!) {
|
|
@@ -48,3 +48,20 @@ query GetCustomerById($id: String!){
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
`;
|
|
51
|
+
exports.SEARCH_COMPANY = (0, graphql_tag_1.gql) `
|
|
52
|
+
query SearchCompany($keyword: String, $orgId: String!, $limit: Number){
|
|
53
|
+
searchCompany(keyword: "string", orgId: "string", limit: 1) {
|
|
54
|
+
id
|
|
55
|
+
name
|
|
56
|
+
address
|
|
57
|
+
gender
|
|
58
|
+
identityNumber
|
|
59
|
+
birthDate
|
|
60
|
+
email
|
|
61
|
+
phone
|
|
62
|
+
createdStamp
|
|
63
|
+
createdBy
|
|
64
|
+
memberLevel
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
@@ -7,4 +7,5 @@ export declare class UserService extends Service {
|
|
|
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
9
|
getCustomerById(id: string): Promise<any>;
|
|
10
|
+
searchCompany(keyword: string): Promise<any>;
|
|
10
11
|
}
|
|
@@ -113,5 +113,23 @@ class UserService extends service_1.Service {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
+
searchCompany(keyword) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const query = queries_1.SEARCH_COMPANY;
|
|
119
|
+
const variables = {
|
|
120
|
+
keyword,
|
|
121
|
+
orgId: this.orgId,
|
|
122
|
+
limit: 1,
|
|
123
|
+
};
|
|
124
|
+
try {
|
|
125
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
126
|
+
return response.searchCompany;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.log(`Error in searchCompany: ${error}`);
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
116
134
|
}
|
|
117
135
|
exports.UserService = UserService;
|