Skip to content

Commit 05a82cb

Browse files
committed
Test case updated
1 parent 854b509 commit 05a82cb

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/contentstackCollection.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ export default class ContentstackCollection {
55
data.stackHeaders = stackHeaders
66
}
77
this.items = wrapperCollection(http, data)
8-
if (response.data.schema !== undefined) {
9-
this.schema = response.data.schema
8+
if (data.schema !== undefined) {
9+
this.schema = data.schema
1010
}
11-
if (response.data.content_type !== undefined) {
12-
this.content_type = response.data.content_type
11+
if (data.content_type !== undefined) {
12+
this.content_type = data.content_type
1313
}
14-
if (response.data.count !== undefined) {
15-
this.count = response.data.count
14+
if (data.count !== undefined) {
15+
this.count = data.count
1616
}
17-
if (response.data.notice !== undefined) {
18-
this.notice = response.data.notice
17+
if (data.notice !== undefined) {
18+
this.notice = data.notice
1919
}
2020
}
2121
}

lib/stack/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export function Stack (http, data) {
3333
if (this.management_token && this.management_token) {
3434
this.stackHeaders.authorization = this.management_token
3535
}
36-
delete this.api_key
3736
delete this.management_token
3837
/**
3938
* @description The Update stack call lets you update the name and description of an existing stack.
@@ -630,7 +629,8 @@ export function Stack (http, data) {
630629
}
631630

632631
export function StackCollection (http, data) {
633-
const obj = cloneDeep(data.stacks)
632+
const stacks = data.stacks || []
633+
const obj = cloneDeep(stacks)
634634
const stackCollection = obj.map((userdata) => {
635635
return new Stack(http, { stack: userdata })
636636
})

0 commit comments

Comments
 (0)