Upload files to a book from show book view.

This commit is contained in:
krzysiej
2022-05-31 15:25:57 +02:00
parent 623aa91872
commit 26bd59f3bb
4 changed files with 87 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
// mydropzone_controller.js
import { Controller } from '@hotwired/stimulus';
import axios from 'axios';
export default class extends Controller {
connect() {
@@ -18,19 +19,27 @@ export default class extends Controller {
_onConnect(event) {
// The dropzone was just created
console.info(event);
// console.info(event);
console.info('onconnect');
//
// axios.get('/book/search/modyfikowany+węgiel').then(response => {
// console.info(response.data);
// });
}
_onChange(event) {
// The dropzone just changed
console.info(event);
console.info('onchange');
event.target.closest('form').submit();
}
_onClear(event) {
// The dropzone has just been cleared
console.info(event);
// console.info(event);
console.info('onclear');
}
}