Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Add POS permission by user
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Nov 18, 2021
1 parent ccac64b commit 65c2ce2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"license": "MIT",
"dependencies": {
"@2fd/graphdoc": "^2.4.0",
"@adempiere/grpc-api": "2.3.8",
"@adempiere/grpc-api": "2.3.9",
"@adempiere/grpc-web-store-api": "1.4.5",
"@elastic/elasticsearch": "^7.3.0",
"@google-cloud/storage": "^3.0.3",
Expand Down
8 changes: 6 additions & 2 deletions src/modules/adempiere-store/api/img.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default ({ config, db, service }) =>
res.set('Allow', 'GET');
return res.status(405).send('Method Not Allowed');
}

req.socket.setMaxListeners(config.imageable.maxListeners || 50);

let width;
Expand Down Expand Up @@ -111,7 +110,6 @@ export default ({ config, db, service }) =>
console.log(
`[URL]: ${imgUrl} - [ACTION]: ${action} - [WIDTH]: ${width} - [HEIGHT]: ${height}`
);

let buffer;
if (config.modules.adempiereStore.images.httpBased) {
try {
Expand All @@ -125,6 +123,12 @@ export default ({ config, db, service }) =>
} else {
try {
buffer = Buffer.from(await getResource(service, resourceName));
if (buffer.length === 0) {
return res.status(400).send({
code: 400,
result: `Unable to download the requested image ${imgUrl}`
});
}
} catch (err) {
return res.status(400).send({
code: 400,
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/[email protected].8":
version "2.3.8"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-2.3.8.tgz#1f641647eb223f45fcbf74a88168d1acea8915a3"
integrity sha512-cuMggylTV69gFv85vsjiCetABemOb+VxzSSl/jCBE2ogWqSLa1ERcDNdjvk17oY5moxEiTeYVIY0qieo7tHYgQ==
"@adempiere/[email protected].9":
version "2.3.9"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-2.3.9.tgz#dcc3cdc5d947a7a5c3c08724bf001dcf0f8c6f5e"
integrity sha512-0Y7io+nFy1tSU/1Tc4lj0prOAxcalFK6juPiT1K80YUCDHmlP3/E6ms1m/3lowi0umVV5jlJpzWt23j/NHubDw==
dependencies:
"@grpc/grpc-js" "1.3.7"
google-protobuf "3.17.3"
Expand Down

0 comments on commit 65c2ce2

Please sign in to comment.