Removed event bus and switched to vuex. Implemented vue dropzone.

This commit is contained in:
krzysiej
2022-06-15 15:19:46 +02:00
parent 5350c5c46b
commit 4536195a4c
16 changed files with 151 additions and 88 deletions

View File

@@ -8,8 +8,6 @@ export default {
})
},
bookUpdateProgress(bookId, progress) {
console.info(bookId);
console.info(progress);
return axios.post('/progress/update', {
bookId: bookId,
progress: progress

20
assets/js/api/file.js Normal file
View File

@@ -0,0 +1,20 @@
import axios from 'axios';
export default {
deleteFile: function (fileId) {
return axios.get(window.location.origin + '/file/delete/' + fileId);
},
getFiles: function (bookId) {
return axios.get(this.getFilesEndpoint(bookId), {
headers: {
'accept': 'application/json'
}
});
},
getFilesEndpoint: function (bookId) {
if (bookId) {
return `/api/books/${bookId}/files`;
}
return `/api/files`;
}
}