Skip to content

Commit bf3fd18

Browse files
committed
Branch on stack header issue resolve
1 parent e8cfb62 commit bf3fd18

File tree

5 files changed

+1449
-315
lines changed

5 files changed

+1449
-315
lines changed

lib/contentstackClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default function contentstackClient ({ http }) {
9090
* import * as contentstack from '@contentstack/management'
9191
* const client = contentstack.client()
9292
*
93-
* client.stack({ api_key: 'api_key', management_token: 'management_token', branch_name: 'branch' }).contentType('content_type_uid').fetch()
93+
* client.stack({ api_key: 'api_key', management_token: 'management_token', branch_uid: 'branch_uid' }).contentType('content_type_uid').fetch()
9494
* .then((stack) => console.log(stack))
9595
*/
9696
function stack (params = {}) {

lib/stack/branchAlias/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ export function BranchAlias (http, data = {}) {
7676
this.fetch = async function (param = {}) {
7777
try {
7878
const headers = {
79-
headers: { ...cloneDeep(this.stackHeaders) }
79+
headers: { ...cloneDeep(this.stackHeaders) },
80+
params: {
81+
...cloneDeep(param)
82+
}
8083
} || {}
8184
const response = await http.get(this.urlPath, headers)
8285
if (response.data) {

lib/stack/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export function Stack (http, data) {
3838
delete this.management_token
3939
}
4040

41+
if (this.branch_uid) {
42+
this.stackHeaders.branch = this.branch_uid
43+
}
4144
/**
4245
* @description The Update stack call lets you update the name and description of an existing stack.
4346
* @memberof Stack

0 commit comments

Comments
 (0)