File tree Expand file tree Collapse file tree 2 files changed +1568
-15
lines changed
rest_framework_docs/static/rest_framework_docs/js Expand file tree Collapse file tree 2 files changed +1568
-15
lines changed Original file line number Diff line number Diff line change 1+ var _ = require ( 'underscore' ) ;
12var React = require ( 'react' ) ;
23
34var FieldsData = require ( './request/fields-data' ) ;
@@ -17,7 +18,8 @@ var Request = React.createClass({
1718
1819 componentWillMount : function ( ) {
1920 var endpoint = this . props . endpoint ;
20- endpoint [ 'methods' ] = this . transformMethods ( endpoint . methods ) ;
21+ endpoint [ 'methods' ] = _ . isArray ( endpoint . methods ) ?
22+ endpoint . methods : this . transformMethods ( endpoint . methods ) ;
2123
2224 this . setState ( {
2325 endpoint : endpoint ,
@@ -88,7 +90,7 @@ var Request = React.createClass({
8890
8991 { RequestUtils . shouldAddData ( this . state . method ) ? null : (
9092 < div >
91- < Header title = 'Data' />
93+ { this . state . endpoint . fields . length ? < Header title = 'Data' /> : null }
9294 < FieldsData
9395 fields = { endpoint . fields }
9496 data = { this . state . data }
You can’t perform that action at this time.
0 commit comments