You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a model Author that has an Authored Books field that can have links to multiple Book entries, is it possible to use update(), or another method, to add a book link to the Authored Books field, rather than overwriting it?
For example, if we have the following, can we add a book to the list?
Author: Dr. Seuss
Authored Books: ["Green Eggs and Ham", "The Cat in the Hat"]
With update(), it overwrites the field:
// Simplified code
cmaClient.entry.update(
{ entryId: 1 },
{
fields: {
authoredBooks: { ["How the Grinch Stole Christmas"] }
}
)
// Results in
Authored Books: ["How the Grinch Stole Christmas"]
instead of
Authored Books: ["Green Eggs and Ham", "The Cat in the Hat", "How the Grinch Stole Christmas"]
It seems I could use get() in combination with update(), and use the spread operator, but is it possible to do it with one API call?
EDIT: This issue is similar to another issue I opened, so closing this one.
The text was updated successfully, but these errors were encountered:
If we have a model
Author
that has anAuthored Books
field that can have links to multipleBook
entries, is it possible to use update(), or another method, to add a book link to theAuthored Books
field, rather than overwriting it?For example, if we have the following, can we add a book to the list?
With update(), it overwrites the field:
It seems I could use get() in combination with update(), and use the spread operator, but is it possible to do it with one API call?
EDIT: This issue is similar to another issue I opened, so closing this one.
The text was updated successfully, but these errors were encountered: