File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,9 @@ export class FormFileInput extends React.Component {
216216 this . setState ( { loading : true } ) ;
217217
218218 let formData = new FormData ( ) ;
219+ formData . append ( 'field_name' , this . context . fieldName ) ;
220+ formData . append ( 'model_name' , this . context . modelName ) ;
221+ formData . append ( 'coordinates' , JSON . stringify ( this . props . name . split ( '-' ) . slice ( 1 ) ) ) ;
219222 formData . append ( 'file' , e . target . files [ 0 ] ) ;
220223
221224 fetch ( endpoint , {
Original file line number Diff line number Diff line change @@ -173,7 +173,9 @@ export default class Form extends React.Component {
173173 < fieldset className = "module aligned" >
174174 < EditorContext . Provider
175175 value = { {
176- fileUploadEndpoint : this . props . fileUploadEndpoint
176+ fileUploadEndpoint : this . props . fileUploadEndpoint ,
177+ fieldName : this . props . fieldName ,
178+ modelName : this . props . modelName ,
177179 } }
178180 >
179181 { this . getFields ( ) }
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ export default function JSONForm(config) {
77 this . schema = config . schema ;
88 this . data = config . data ;
99 this . fileUploadEndpoint = config . fileUploadEndpoint ;
10+ this . fieldName = config . fieldName ;
11+ this . modelName = config . modelName ;
1012
1113 this . render = function ( ) {
1214 ReactDOM . render (
@@ -15,6 +17,8 @@ export default function JSONForm(config) {
1517 dataInputId = { this . dataInputId }
1618 data = { this . data }
1719 fileUploadEndpoint = { this . fileUploadEndpoint }
20+ fieldName = { this . fieldName }
21+ modelName = { this . modelName }
1822 /> ,
1923 document . getElementById ( this . containerId )
2024 ) ;
You can’t perform that action at this time.
0 commit comments