-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating an entry with File fields #48
Comments
Thanks @fcmsilva for raising the issue. If you want to update few fields you can directly use the const exEntry = await stack
.contentType("content_type")
.entry("xxxxxxxx");
exEntry.title = "newTitle";
exEntry.update(); Let us know if you still face issue with above example. |
Thanks for your help, however group: [
{text: "Text", image: asset1}
{text: "Text 2", image: asset2}
] Now I want to change the text of the first element of the group, from "Text" to "Text 1". entry.group = [{text: "Text 1"}]
entry.update(); This obviously does not work, as it replaces the whole group with just So from there the only option I see is using For simple entries this is not a big issue, as just doing something like |
Hi @fcmsilva we will be looking into this and we will get back once we have update |
Given a simple entry edit like this:
Knowing that the entry that we're editing has a File field, this update will not work, with the following error:
I suppose this is because the
update
call is expecting just an array of uid's of each asset, but whatfetch
is retrieving is an object with the details of the asset. This might not be the expected behaviour, and make editing an entry with files harder, requiring some workarounds for the entry to be accepted when callingupdate
.I feel that adding an option in the
fetch
call to return only the assets' uid instead of the full object with details would be helpful. Either that, or for theupdate
calls to support both uid strings and objects with an uid.The text was updated successfully, but these errors were encountered: