File tree Expand file tree Collapse file tree 3 files changed +23
-22
lines changed
types/stack/bulkOperation Expand file tree Collapse file tree 3 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -47,23 +47,23 @@ export function BulkOperation (http, data = {}) {
4747 * // Bulk nested publish
4848 * import * as contentstack from '@contentstack/management'
4949 * const client = contentstack.client()
50- * {
51- * environments:["{{env_uid}}","{{env_uid}}"],
52- * locales:["en-us"],
53- * items :[
54- * {
55- * _content_type_uid: '{{content_type_uid}}',
56- * uid: '{{entry_uid}}'
57- * },
58- * {
59- * _content_type_uid: '{{content_type_uid}}',
60- * uid: '{{entry_uid}}'
61- * },
62- * {
63- * _content_type_uid: '{{content_type_uid}}',
64- * uid: '{{entry_uid}}'
65- * }
66- * ]
50+ * const publishDetails = {
51+ * environments:["{{env_uid}}","{{env_uid}}"],
52+ * locales:["en-us"],
53+ * entries :[
54+ * {
55+ * _content_type_uid: '{{content_type_uid}}',
56+ * uid: '{{entry_uid}}'
57+ * },
58+ * {
59+ * _content_type_uid: '{{content_type_uid}}',
60+ * uid: '{{entry_uid}}'
61+ * },
62+ * {
63+ * _content_type_uid: '{{content_type_uid}}',
64+ * uid: '{{entry_uid}}'
65+ * }
66+ * ]
6767 * }
6868 * client.stack({ api_key: 'api_key'}).bulkOperation().publish({ details: publishDetails, is_nested: true })
6969 * .then((response) => { console.log(response.notice) })
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ export function Stack (http, data) {
3535 if ( data && data . stack && data . stack . api_key ) {
3636 this . stackHeaders = { api_key : this . api_key }
3737 if ( this . management_token && this . management_token !== undefined ) {
38- this . stackHeaders . authorization = this . management_token
38+ // this.stackHeaders.authorization = this.management_token
39+ http . defaults . headers . authorization = this . management_token
3940 delete this . management_token
4041 }
4142
@@ -452,17 +453,17 @@ export function Stack (http, data) {
452453 * .then((response) => console.log(response.notice))
453454 *
454455 */
455- this . updateUsersRoles = async ( users ) => {
456+ this . updateUsersRoles = async ( data ) => {
456457 try {
457458 const response = await http . post ( `${ this . urlPath } /users/roles` ,
458- { users } ,
459+ { users : data } ,
459460 {
460461 headers : {
461462 ...cloneDeep ( this . stackHeaders )
462463 }
463464 } )
464465 if ( response . data ) {
465- return UserCollection ( http , response . data . stack )
466+ return response . data
466467 } else {
467468 return error ( response )
468469 }
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export interface BulkOperationConfig {
1717}
1818
1919export interface PublishItems extends PublishDetails {
20- items : Array < BulkOperationItem >
20+ entries : Array < BulkOperationItem >
2121}
2222
2323export interface BulkOperationItem {
You can’t perform that action at this time.
0 commit comments