mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-05 02:34:56 +02:00
Clean up ApiRouter adding MiscController, move upload and scan to api endpoints
This commit is contained in:
parent
69fcb103e4
commit
57399bb79e
14 changed files with 299 additions and 270 deletions
|
@ -46,7 +46,7 @@ export const actions = {
|
|||
var updatePayload = {
|
||||
...payload
|
||||
}
|
||||
return this.$axios.$patch('/api/serverSettings', updatePayload).then((result) => {
|
||||
return this.$axios.$patch('/api/settings', updatePayload).then((result) => {
|
||||
if (result.success) {
|
||||
commit('setServerSettings', result.serverSettings)
|
||||
return true
|
||||
|
|
|
@ -33,6 +33,14 @@ export const getters = {
|
|||
}
|
||||
|
||||
export const actions = {
|
||||
requestLibraryScan({ state, commit }, { libraryId, force }) {
|
||||
this.$axios.$get(`/api/libraries/${libraryId}/scan`, { params: { force } }).then(() => {
|
||||
this.$toast.success('Library scan started')
|
||||
}).catch((error) => {
|
||||
console.error('Failed to start scan', error)
|
||||
this.$toast.error('Failed to start scan')
|
||||
})
|
||||
},
|
||||
loadFolders({ state, commit }) {
|
||||
if (state.folders.length) {
|
||||
var lastCheck = Date.now() - state.folderLastUpdate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue