Skip to content

Commit

Permalink
Added condition to check if form object exist or not
Browse files Browse the repository at this point in the history
  • Loading branch information
ptugger committed Aug 31, 2023
1 parent b50150e commit 1778f38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
30 changes: 15 additions & 15 deletions app/frontend/src/components/designer/FormViewerMultiUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,21 +309,21 @@ export default {
jsonPayload.forEach(function (submission) {
delete submission.submit;
delete submission.lateEntry;
const propsToRemove = new Set([
'confirmationId',
'formName',
'version',
'createdAt',
'fullName',
'username',
'email',
'status',
'assignee',
'assigneeEmail',
]);
propsToRemove.forEach((key) => delete submission.form[key]);
if (Object.prototype.hasOwnProperty.call(submission, 'form')) {
const propsToRemove = [
'confirmationId',
'formName',
'version',
'createdAt',
'fullName',
'username',
'email',
'status',
'assignee',
'assigneeEmail',
];
propsToRemove.forEach((key) => delete submission.form[key]);
}
});
}
return jsonPayload;
Expand Down
7 changes: 4 additions & 3 deletions app/src/forms/form/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,11 @@ const service = {
jsonPayload.forEach(function (submission) {
delete submission.submit;
delete submission.lateEntry;
if (Object.prototype.hasOwnProperty.call(submission, 'form')) {
const propsToRemove = ['confirmationId', 'formName', 'version', 'createdAt', 'fullName', 'username', 'email', 'status', 'assignee', 'assigneeEmail'];

const propsToRemove = new Set(['confirmationId', 'formName', 'version', 'createdAt', 'fullName', 'username', 'email', 'status', 'assignee', 'assigneeEmail']);

propsToRemove.forEach((key) => delete submission.form[key]);
propsToRemove.forEach((key) => delete submission.form[key]);
}
});
}
return jsonPayload;
Expand Down

0 comments on commit 1778f38

Please sign in to comment.