Skip to content

Commit 1526b11

Browse files
committed
entry doc udpdate
1 parent 4c0b8b5 commit 1526b11

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/stack/contentType/entry/index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,34 @@ export function Entry (http, data) {
5858
* })
5959
* .then((entry) => console.log(entry))
6060
*
61+
* @example
62+
* // To update entry with asset field
63+
* import * as contentstack from '@contentstack/management'
64+
* const client = contentstack.client()
65+
*
66+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').fetch()
67+
* .then((entry) => {
68+
* entry.title = 'My New Entry'
69+
* entry.file = entry.file.uid // for single asset pass asset uid to entry asset field value
70+
* entry.multiple_file = ['asset_uid_1', 'asset_uid_2'] // for multiple asset pass array of asset uid to entry asset field values
71+
* return entry.update({ locale: 'en-at' })
72+
* })
73+
* .then((entry) => console.log(entry))
74+
*
75+
* @example
76+
* // To update entry with reference field
77+
* import * as contentstack from '@contentstack/management'
78+
* const client = contentstack.client()
79+
*
80+
* client.stack({ api_key: 'api_key'}).contentType('content_type_uid').entry('uid').fetch()
81+
* .then((entry) => {
82+
* entry.title = 'My New Entry'
83+
* entry.reference = entry.reference.uid // for single reference pass reference uid to entry reference field value
84+
* entry.multiple_reference = ['reference_uid_1', 'reference_uid_2'] // for multiple reference pass array of reference uid to entry reference field values
85+
* entry.multiple_content_type_reference = [{_content_type_uid: 'content_type_uid_1', uid: 'reference_uid_1'}, {_content_type_uid: 'content_type_uid_2', uid: 'reference_uid_2'}] // for multiple reference pass array of reference uid to entry reference field values
86+
* return entry.update({ locale: 'en-at' })
87+
* })
88+
* .then((entry) => console.log(entry))
6189
*/
6290
this.update = update(http, 'entry')
6391

0 commit comments

Comments
 (0)