Skip to content

Commit dfa6c88

Browse files
committed
test: ✅ Test cases update
1 parent c7bb103 commit dfa6c88

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ contentstackClient.stack({ api_key: 'API_KEY' }).asset().create({ asset })
104104
- [Content Management API Docs](https://www.contentstack.com/docs/developers/apis/content-management-api)
105105

106106
### The MIT License (MIT)
107-
Copyright © 2012-2020 [Contentstack](https://www.contentstack.com/). All Rights Reserved
107+
Copyright © 2012-2021 [Contentstack](https://www.contentstack.com/). All Rights Reserved
108108

109109
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
110110

lib/contentstackClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export default function contentstackClient ({ http }) {
8787
*
8888
*/
8989
function stack (params = {}) {
90-
const stackParam = { ...cloneDeep(params) }
91-
return new Stack(http, { stackParam })
90+
const stack = { ...cloneDeep(params) }
91+
return new Stack(http, { stack })
9292
}
9393

9494
/**

lib/core/contentstackHTTPClient.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default function contentstackHttpClient (options) {
7272
if (query) {
7373
qs = qs + `&query=${encodeURI(JSON.stringify(query))}`
7474
}
75+
params.query = query
7576
return qs
7677
}
7778
}

lib/entity.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const update = (http, type) => {
151151
}
152152
})
153153
if (response.data) {
154-
return new this.constructor(http, parseData(response, this.stackHeaders, this.contentType_uid))
154+
return new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid))
155155
} else {
156156
throw error(response)
157157
}
@@ -199,7 +199,7 @@ export const fetch = (http, type) => {
199199
response.data[type]['content_type'] = response.data['content_type']
200200
response.data[type]['schema'] = response.data['schema']
201201
}
202-
return new this.constructor(http, parseData(response, this.stackHeaders))
202+
return new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid))
203203
} else {
204204
throw error(response)
205205
}
@@ -215,7 +215,7 @@ export function parseData (response, stackHeaders, contentTypeUID) {
215215
data.stackHeaders = stackHeaders
216216
}
217217
if (contentTypeUID) {
218-
data.content_type = contentTypeUID
218+
data.content_type_uid = contentTypeUID
219219
}
220220
return data
221221
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"nyc": {
1515
"exclude": [
1616
"**/bulkOperation",
17+
"**/items",
1718
"**/test"
1819
]
1920
},

0 commit comments

Comments
 (0)