implements upload field type with ability to select existing upload

This commit is contained in:
James
2020-06-27 16:35:21 -04:00
parent e7eca5b30c
commit df930ae97e
18 changed files with 255 additions and 172 deletions

View File

@@ -50,6 +50,17 @@ module.exports = async (config, operation) => {
const traverseFields = (fields, data = {}, path) => {
fields.forEach((field) => {
const dataCopy = data;
if (field.type === 'upload') {
if (data[field.name] === '') dataCopy[field.name] = null;
}
if (field.type === 'checkbox') {
if (data[field.name] === 'true') dataCopy[field.name] = true;
if (data[field.name] === 'false') dataCopy[field.name] = false;
}
policyPromises.push(createPolicyPromise(data, field));
hookPromises.push(createHookPromise(data, field));