Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
fix: Change List Entities. (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Feb 16, 2023
1 parent 2f38112 commit bd082a1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"license": "MIT",
"dependencies": {
"@2fd/graphdoc": "^2.4.0",
"@adempiere/grpc-api": "3.9.7",
"@adempiere/grpc-api": "3.9.8",
"@adempiere/grpc-web-store-api": "1.5.7",
"@elastic/elasticsearch": "7.14.0",
"@google-cloud/storage": "^3.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,36 +508,40 @@ module.exports = ({ config }) => {
});

/**
* GET Entities, used for window list
* POST Get List Entities, used for window list
*
* req.query.token - user token
* req.query.language - login language
* req.query.page_size - size of page (customized)
* req.query.page_token - token of page (optional for get a specific page)
* req.query.filters - query filters
* req.query.table_name - table name (Mandatory if is not a query)
* req.query.query - custom query instead a table name based on SQL
* req.query.where_clause - where clause of search based on SQL
* req.query.order_by_clause - order by clause based on SQL
* req.query.limit - records limit
* req.body.search_value - search value
* req.body.filters - query filters
* req.body.table_name - table name (Mandatory if is not a query)
* req.body.query - custom query instead a table name based on SQL
* req.body.where_clause - where clause of search based on SQL
* req.body.order_by_clause - order by clause based on SQL
* req.body.limit - records limit
*
* Details:
*/
api.get('/entities', (req, res) => {
if (req.query) {
api.post('/entities', (req, res) => {
if (req.body) {
const ServiceApi = require('@adempiere/grpc-api/src/services/userInterface');
const service = new ServiceApi(config);

service.listTabEntities({
token: req.query.token,
language: req.query.language,
// Running parameters
windowUuid: req.query.window_uuid,
tabUuid: req.query.tab_uuid,
windowNo: req.query.window_no,
windowUuid: req.body.window_uuid,
tabUuid: req.body.tab_uuid,
windowNo: req.body.window_no,
// DSL Query
filters: req.query.filters,
filters: req.body.filters,
// Custom Query
sorting: req.query.sorting,
contextAttributes: req.query.context_attributes,
searchValue: req.query.search_value,
sorting: req.body.sorting,
contextAttributes: req.body.context_attributes,
searchValue: req.body.search_value,
// Page Data
pageSize: req.query.page_size,
pageToken: req.query.page_token
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
striptags "^3.0.1"
word-wrap "^1.2.1"

"@adempiere/grpc-api@3.9.7":
version "3.9.7"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-3.9.7.tgz#cbfc52fc2bc4f5f93a91bb81d3963a3d43f1e849"
integrity sha512-hVX7UXT2GJoQhaIcuUlFBuvJtqHIkvjJRqQSht6zoa0RtTlpET0uy8PTaOh9YthO//l3kkMmOfKuC3rv/kQxTw==
"@adempiere/grpc-api@3.9.8":
version "3.9.8"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-3.9.8.tgz#7f8d8ff64b8c8cf8e28494e2a43a28db41bdc59a"
integrity sha512-u4yeqA2seLw6D3tLwZNspJSiA42qPB/X6cqHL3fnd/8Hh5RrnDZoVsT5Qxn5SbqHwyojcycST9lf3idoXDij0A==
dependencies:
"@grpc/grpc-js" "1.8.8"
google-protobuf "3.21.2"
Expand Down

0 comments on commit bd082a1

Please sign in to comment.