@ejfdelgado/ejflab-back 1.30.1 → 1.30.2
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/package.json +1 -1
- package/srv/common/General.mjs +4 -2
package/package.json
CHANGED
package/srv/common/General.mjs
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import md5 from 'md5';
|
2
2
|
import { MalaPeticionException, ParametrosIncompletosException } from '../MyError.mjs';
|
3
|
+
import { SimpleObj } from "@ejfdelgado/ejflab-common/src/SimpleObj.js";
|
3
4
|
|
4
5
|
export class General {
|
5
6
|
static PAGE_SIZE_DEFAULT = "20";
|
@@ -23,8 +24,9 @@ export class General {
|
|
23
24
|
}
|
24
25
|
static readParam(req, name, pred = null, complain = false) {
|
25
26
|
const nameLower = name.toLowerCase();
|
26
|
-
|
27
|
-
|
27
|
+
const first = SimpleObj.getValue(req.body, name, undefined);
|
28
|
+
if (first !== undefined) {
|
29
|
+
return first;
|
28
30
|
} else if (req.query && name in req.query) {
|
29
31
|
return req.query[name];
|
30
32
|
} else if (req.query && nameLower in req.query) {
|