Skip to content

Commit e868066

Browse files
Support the Include snippet schema feature
1 parent a881c7c commit e868066

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/core/lib/request.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ export default function Request(options) {
4242
queryParams = serialize(options.body);
4343
}
4444

45-
4645
fetch(url + '?' + queryParams, {
4746
method: 'GET',
4847
headers: headers
4948
})
50-
.then(function(response) {
49+
.then(function(response) {
5150
if (response.ok && response.status === 200) {
5251
let data = response.json();
5352
resolve(data);

src/core/modules/entry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export default class Entry {
190190
*/
191191
includeSchema() {
192192
this._query['include_schema'] = true;
193+
this._query['include_snippet_schema'] = true;
193194
return this;
194195
}
195196

@@ -226,6 +227,7 @@ export default class Entry {
226227
*/
227228
includeContentType() {
228229
this._query['include_content_type'] = true;
230+
this._query['include_snippet_schema'] = true;
229231
return this;
230232
}
231233

src/core/modules/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ export default class Query extends Entry {
652652
query: this._query
653653
}
654654
};
655-
return Utils.sendRequest(this);
655+
return Utils.sendRequest(this);
656656
}
657657

658658
/**

src/core/stack.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export default class Stack {
372372
* @returns {Stack}
373373
* @instance
374374
*/
375-
getContentTypes() {
375+
getContentTypes(param) {
376376
let query = {
377377
method: 'POST',
378378
headers: this.headers,
@@ -382,6 +382,11 @@ export default class Stack {
382382
environment: this.environment
383383
}
384384
};
385+
if(param && param !== undefined) {
386+
for( var key in param) {
387+
query.body[key] = param[key]
388+
}
389+
}
385390
return Request(query);
386391
}
387392

0 commit comments

Comments
 (0)