Skip to content

Commit 1253f7d

Browse files
authored
fix: resource doesn't update if file attached (#103)
1 parent 85914d7 commit 1253f7d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: app/controllers/avo/resources_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def update
107107

108108
# Filter out the file params
109109
regular_resource_params = resource_params.select do |id, value|
110-
!avo_resource.attached_file_fields.map(&:id).include? id
110+
!avo_resource.attached_file_fields.map(&:id).to_s.include? id
111111
end
112112

113113
if avo_resource.has_devise_password and regular_resource_params[:password].blank?

Diff for: app/frontend/js/components/Edit/FileField.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<a-button color="indigo"
1414
@click="deleteFile"
1515
v-if="value"
16-
><trash-icon class="h-4 mr-1" /> Delete {{field.filename}}</a-button>
16+
><trash-icon class="h-4 mr-1" /> Delete file</a-button>
1717
</template>
1818
</edit-field-wrapper>
1919
</template>

0 commit comments

Comments
 (0)