diff --git a/resources/js/components/DetailField.vue b/resources/js/components/DetailField.vue index 345be80..082547e 100644 --- a/resources/js/components/DetailField.vue +++ b/resources/js/components/DetailField.vue @@ -146,13 +146,13 @@ export default { * Gather the action FormData for the given action. */ actionFormData() { - return _.tap(new FormData(), (formData) => { - formData.append('resources', this.selectedResources); - - _.each(this.selectedAction.fields, (field) => { - field.fill(formData); - }); + const formData = new FormData(); + formData.append('resources', this.selectedResources); + (this.selectedAction.fields || []).forEach((field) => { + field.fill(formData); }); + + return formData; }, /** diff --git a/resources/js/components/IndexField.vue b/resources/js/components/IndexField.vue index 649c606..11ae186 100644 --- a/resources/js/components/IndexField.vue +++ b/resources/js/components/IndexField.vue @@ -179,13 +179,13 @@ export default { * Gather the action FormData for the given action. */ actionFormData() { - return _.tap(new FormData(), (formData) => { - formData.append('resources', this.selectedResources); - - _.each(this.selectedAction.fields, (field) => { - field.fill(formData); - }); + const formData = new FormData(); + formData.append('resources', this.selectedResources); + (this.selectedAction.fields || []).forEach((field) => { + field.fill(formData); }); + + return formData; }, /**