File tree Expand file tree Collapse file tree 7 files changed +22
-6
lines changed Expand file tree Collapse file tree 7 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -1039,7 +1039,7 @@ var Stack = function () {
1039
1039
1040
1040
} , {
1041
1041
key : 'getContentTypes' ,
1042
- value : function getContentTypes ( ) {
1042
+ value : function getContentTypes ( param ) {
1043
1043
var query = {
1044
1044
method : 'POST' ,
1045
1045
headers : this . headers ,
@@ -1049,6 +1049,11 @@ var Stack = function () {
1049
1049
environment : this . environment
1050
1050
}
1051
1051
} ;
1052
+ if ( param && param !== undefined ) {
1053
+ for ( var key in param ) {
1054
+ query . body [ key ] = param [ key ] ;
1055
+ }
1056
+ }
1052
1057
return ( 0 , _request2 . default ) ( query ) ;
1053
1058
}
1054
1059
@@ -2000,6 +2005,7 @@ var Entry = function () {
2000
2005
key : "includeSchema" ,
2001
2006
value : function includeSchema ( ) {
2002
2007
this . _query [ 'include_schema' ] = true ;
2008
+ this . _query [ 'include_snippet_schema' ] = true ;
2003
2009
return this ;
2004
2010
}
2005
2011
@@ -2041,6 +2047,7 @@ var Entry = function () {
2041
2047
key : "includeContentType" ,
2042
2048
value : function includeContentType ( ) {
2043
2049
this . _query [ 'include_content_type' ] = true ;
2050
+ this . _query [ 'include_snippet_schema' ] = true ;
2044
2051
return this ;
2045
2052
}
2046
2053
@@ -2870,6 +2877,7 @@ var Query = function (_Entry) {
2870
2877
query : this . _query
2871
2878
}
2872
2879
} ;
2880
+
2873
2881
return Utils . sendRequest ( this ) ;
2874
2882
}
2875
2883
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class ContentstackDemo {
26
26
*/
27
27
getEntries ( contentTypeUid ) {
28
28
contentTypeUid = contentTypeUid || 'source'
29
- return this . Stack . ContentType ( contentTypeUid ) . Query ( ) . toJSON ( ) . find ( )
29
+ return this . Stack . ContentType ( 'dinu1234' ) . Query ( ) . includeSchema ( ) . toJSON ( ) . find ( )
30
+ //return this.Stack.getContentTypes(contentTypeUid)
30
31
31
32
}
32
33
Original file line number Diff line number Diff line change @@ -42,12 +42,11 @@ export default function Request(options) {
42
42
queryParams = serialize ( options . body ) ;
43
43
}
44
44
45
-
46
45
fetch ( url + '?' + queryParams , {
47
46
method : 'GET' ,
48
47
headers : headers
49
48
} )
50
- . then ( function ( response ) {
49
+ . then ( function ( response ) {
51
50
if ( response . ok && response . status === 200 ) {
52
51
let data = response . json ( ) ;
53
52
resolve ( data ) ;
Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ export default class Entry {
190
190
*/
191
191
includeSchema ( ) {
192
192
this . _query [ 'include_schema' ] = true ;
193
+ this . _query [ 'include_snippet_schema' ] = true ;
193
194
return this ;
194
195
}
195
196
@@ -226,6 +227,7 @@ export default class Entry {
226
227
*/
227
228
includeContentType ( ) {
228
229
this . _query [ 'include_content_type' ] = true ;
230
+ this . _query [ 'include_snippet_schema' ] = true ;
229
231
return this ;
230
232
}
231
233
Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ export default class Query extends Entry {
652
652
query : this . _query
653
653
}
654
654
} ;
655
- return Utils . sendRequest ( this ) ;
655
+ return Utils . sendRequest ( this ) ;
656
656
}
657
657
658
658
/**
Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ export default class Stack {
372
372
* @returns {Stack }
373
373
* @instance
374
374
*/
375
- getContentTypes ( ) {
375
+ getContentTypes ( param ) {
376
376
let query = {
377
377
method : 'POST' ,
378
378
headers : this . headers ,
@@ -382,6 +382,11 @@ export default class Stack {
382
382
environment : this . environment
383
383
}
384
384
} ;
385
+ if ( param && param !== undefined ) {
386
+ for ( var key in param ) {
387
+ query . body [ key ] = param [ key ]
388
+ }
389
+ }
385
390
return Request ( query ) ;
386
391
}
387
392
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments