Some basic components for building forms.
This commit is contained in:
parent
d13fc65ce2
commit
4504d539c5
22 changed files with 827 additions and 246 deletions
|
@ -23,7 +23,8 @@ module.exports = {
|
|||
injectCustomFormTemplates,
|
||||
filterCustomFields,
|
||||
getMjmlTemplate,
|
||||
rollbackAndReleaseConnection
|
||||
rollbackAndReleaseConnection,
|
||||
filterObject
|
||||
};
|
||||
|
||||
function getDefaultMergeTags(callback) {
|
||||
|
@ -293,3 +294,14 @@ function rollbackAndReleaseConnection(connection, callback) {
|
|||
return callback();
|
||||
});
|
||||
}
|
||||
|
||||
function filterObject(obj, allowedKeys) {
|
||||
const result = {};
|
||||
for (const key in obj) {
|
||||
if (allowedKeys.has(key)) {
|
||||
result[key] = obj[key];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue