Solves option importer not being passed to api query.
This commit is contained in:
parent
f9b04440cf
commit
4add863f81
|
@ -408,13 +408,14 @@ export default {
|
|||
let formElement = document.getElementById('importerOptionsForm');
|
||||
let formData = new FormData(formElement);
|
||||
let formObj = {};
|
||||
|
||||
|
||||
for (let [key, value] of formData.entries())
|
||||
formObj[key] = value;
|
||||
|
||||
this.updateImporterOptions({ sessionId: this.sessionId, optionsForm: formObj })
|
||||
.then(updatedImporter => {
|
||||
this.importer = updatedImporter;
|
||||
|
||||
this.finishRunImporter();
|
||||
})
|
||||
.catch((errors) => {
|
||||
|
|
|
@ -60,7 +60,7 @@ class REST_Importers_Controller extends REST_Controller {
|
|||
'description' => __( 'The array describing the destination collectino as expected by the importer', 'tainacan' ),
|
||||
],
|
||||
'options' => [
|
||||
'type' => 'array',
|
||||
'type' => 'array/object',
|
||||
'description' => __( 'The importer options', 'tainacan' ),
|
||||
]
|
||||
],
|
||||
|
|
|
@ -95,10 +95,11 @@ export const updateImporterURL = ( { commit }, { sessionId, url }) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const updateImporterOptions = ( { commit }, { sessionId, options }) => {
|
||||
export const updateImporterOptions = ( { commit }, { sessionId, optionsForm }) => {
|
||||
return new Promise(( resolve, reject ) => {
|
||||
|
||||
axios.tainacan.put('importers/session/' + sessionId, {
|
||||
options: options
|
||||
options: optionsForm
|
||||
})
|
||||
.then( res => {
|
||||
let importer = res.data;
|
||||
|
|
Loading…
Reference in New Issue