Switched getting files with axios request to the api platform.
This commit is contained in:
@@ -69,13 +69,17 @@ export default {
|
||||
return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
|
||||
},
|
||||
getFiles: function () {
|
||||
axios.get(this.getFilesEndpoint()).then(response => this.files = response.data)
|
||||
axios.get(this.getFilesEndpoint(), {
|
||||
headers: {
|
||||
'accept': 'application/json'
|
||||
}
|
||||
}).then(response => this.files = response.data)
|
||||
},
|
||||
getFilesEndpoint: function () {
|
||||
if (this.bookId) {
|
||||
return '/book/' + this.bookId + '/files';
|
||||
return `/api/books/${this.bookId}/files`;
|
||||
}
|
||||
return '/file/all';
|
||||
return `/api/files`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user