Removed event bus and switched to vuex. Implemented vue dropzone.
This commit is contained in:
@@ -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
20
assets/js/api/file.js
Normal 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`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user