Support for tables in frontend

This commit is contained in:
2025-01-31 23:49:41 +01:00
parent e3fba930d2
commit ee6dd16be2
4 changed files with 234 additions and 80 deletions

View File

@ -12,16 +12,17 @@ import alertContactsRoute_schema from './alertContacts_schema.js';
// Router base is '/api/v1'
const Router = express.Router({ strict: false });
// All empty strings are null values.
// All empty strings are null values (body)
Router.use('*', function (req, res, next) {
for (let key in req.body) {
if (req.body[key] === '') {
req.body[key] = null;
req.body[key] = undefined;
}
}
next();
});
// All api routes lowercase! Yea I know but when strict: true it matters.
Router.route('/alertcontacts').get(alertContactsRoute.get).post(alertContactsRoute.post).patch(alertContactsRoute.patch).delete(alertContactsRoute.del);
Router.route('/alertcontacts/describe').get(alertContactsRoute_schema);