@opengis/fastify-table 1.0.64 → 1.0.65
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/Changelog.md +1 -1
- package/crud/controllers/deleteCrud.js +14 -14
- package/package.json +1 -1
package/Changelog.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import dataDelete from '../funcs/dataDelete.js';
|
|
2
|
-
import getTemplate from '../../table/controllers/utils/getTemplate.js';
|
|
3
|
-
|
|
4
|
-
export default async function deleteCrud(req) {
|
|
5
|
-
const loadTemplate = await getTemplate('table', req.params.table);
|
|
6
|
-
const { table } = loadTemplate || req.params || {};
|
|
7
|
-
const { id } = req.params || {};
|
|
8
|
-
|
|
9
|
-
if (!table) return { status: 404, message: 'table is required' };
|
|
10
|
-
|
|
11
|
-
const data = await dataDelete({ table, id });
|
|
12
|
-
|
|
13
|
-
return { rowCount: data.rowCount, msg: !data.rowCount ? data : null };
|
|
14
|
-
}
|
|
1
|
+
import dataDelete from '../funcs/dataDelete.js';
|
|
2
|
+
import getTemplate from '../../table/controllers/utils/getTemplate.js';
|
|
3
|
+
|
|
4
|
+
export default async function deleteCrud(req) {
|
|
5
|
+
const loadTemplate = await getTemplate('table', req.opt?.table || req.params.table);
|
|
6
|
+
const { table } = loadTemplate || req.opt || req.params || {};
|
|
7
|
+
const { id } = req.opt || req.params || {};
|
|
8
|
+
|
|
9
|
+
if (!table) return { status: 404, message: 'table is required' };
|
|
10
|
+
|
|
11
|
+
const data = await dataDelete({ table, id });
|
|
12
|
+
|
|
13
|
+
return { rowCount: data.rowCount, msg: !data.rowCount ? data : null };
|
|
14
|
+
}
|