kschema-fs-api-gen-get-actions 1.4.2 → 1.4.4

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.
@@ -3,7 +3,10 @@ import { ConflictError, StorageError } from "./errors.js";
3
3
 
4
4
  const getFunc = async ({ req, res, inTablePath }) => {
5
5
  try {
6
+ const requestPk = req.params.pk;
7
+
6
8
  const fromService = await Service({
9
+ inPk: requestPk,
7
10
  inTablePath
8
11
  });
9
12
 
@@ -1,9 +1,13 @@
1
1
  import getData from "./getData.js";
2
2
 
3
- const startFunc = async ({ inTablePath }) => {
3
+ const startFunc = async ({ inPk, inTablePath }) => {
4
4
  const dataAsArray = await getData({ inTablePath });
5
5
 
6
- return await dataAsArray;
6
+ const findRow = dataAsArray.find(element => {
7
+ return element.pk === inPk;
8
+ });
9
+
10
+ return await findRow;
7
11
  };
8
12
 
9
13
  export { startFunc };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kschema-fs-api-gen-get-actions",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "start from end points js, generate post methods",
5
5
  "keywords": [
6
6
  "cli",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "kschema-fs-api-gen-rest": "^1.4.2",
14
- "express-fix-endpoints-get-js": "^1.2.2"
14
+ "express-fix-endpoints-get-js": "^1.3.3"
15
15
  },
16
16
  "type": "module",
17
17
  "exports": {