mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Fixed API params
This commit is contained in:
parent
739efa5a36
commit
d0c2af7a15
2 changed files with 1 additions and 17 deletions
|
@ -29,27 +29,12 @@ export default ModalComponent.extend({
|
|||
config: inject(),
|
||||
|
||||
uploadUrl: computed(function () {
|
||||
return `${ghostPaths().apiRoot}/db/importFile`;
|
||||
return `${ghostPaths().apiRoot}/db`;
|
||||
}),
|
||||
|
||||
formData: computed('file', function () {
|
||||
let formData = new FormData();
|
||||
|
||||
formData.append(this.paramName, this.file);
|
||||
|
||||
if (this.mappingResult.labels) {
|
||||
this.mappingResult.labels.forEach((label) => {
|
||||
formData.append('labels', label.name);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.mappingResult.mapping) {
|
||||
let mapping = this.mappingResult.mapping.toJSON();
|
||||
for (let [key, val] of Object.entries(mapping)) {
|
||||
formData.append(`mapping[${key}]`, val);
|
||||
}
|
||||
}
|
||||
|
||||
return formData;
|
||||
}),
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ export default class ContentFileSelect extends Component {
|
|||
event.preventDefault();
|
||||
this.dragClass = null;
|
||||
if (event.dataTransfer.files) {
|
||||
console.log("dropped: ", event.dataTransfer.files);
|
||||
this.fileSelected(event.dataTransfer.files);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue