Hi all !
I have a table that contains a file field type. When Im creating a record on that table, I have no issues at all.
This is what I do:
As you can see here, I just:
- Get field content and upload it on cloudinary
- Get the id cloudinary is returning to me
- I save that id on table field
Perfect !
Problem is when I want to update that file field type. I have two issues there:
Problem number ONE
- When I want to unassign a file to that field ( clicking the ‘X’ here and sending NO file, just like Im showing in the image:
Im getting this error:
Problem number TWO
The opposite situation. I have a record with an empty file and I want to set a file on it. What happens there is this:
Compiler is telling me I cannot modify the content of a readonly type, so, how can I set a file id in there if the field is read only ??
Feature(s) impacted
Its impossible to update a file field using Before Update Hooks
Observed behavior
- If file field was null and you want to assign a new file content, compiler dont let you assign a id value in that field
- If file field was NOT null and you want nullify that field, you get a console error on PUT
( Both situations described above )
Expected behavior
- If I want to delete a file content in a field via edit operation, I should be able to
- If I want to assign a file content in a field what was unassigned before, I should be able too.
Context
- Project name: …
- Team name: Dunsguide
- Environment name: Development
- Agent type & version: @forestadmin/agent = 1.0.0-beta.43, @forestadmin/datasource-sql=1.0.0-beta.40