mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-16 18:25:01 +00:00
api refactoring part 2
This commit is contained in:
@@ -105,7 +105,7 @@ export default {
|
||||
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${this.$router.currentRoute.params.token}/upload/remote`,
|
||||
RequestUpload: `/api/file-request/${this.$router.currentRoute.params.token}/upload/remote`,
|
||||
Public: `/api/editor/upload/remote/${this.$router.currentRoute.params.token}`,
|
||||
}[this.$router.currentRoute.name] || '/api/upload/remote'
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
this.isSendingBillingAlert = true
|
||||
|
||||
axios
|
||||
.patch(`/api/subscriptions/billing-alerts/${this.user.data.relationships.alert.data.id}`, {
|
||||
.put('/api/subscriptions/billing-alert', {
|
||||
amount: this.billingAlertAmount,
|
||||
})
|
||||
.then(() => {
|
||||
@@ -184,7 +184,7 @@ export default {
|
||||
this.isSendingBillingAlert = true
|
||||
|
||||
axios
|
||||
.post('/api/subscriptions/billing-alerts', {
|
||||
.post('/api/subscriptions/billing-alert', {
|
||||
amount: this.billingAlertAmount,
|
||||
})
|
||||
.then(() => {
|
||||
@@ -222,7 +222,7 @@ export default {
|
||||
events.$on('action:confirmed', (data) => {
|
||||
if (data.operation === 'delete-billing-alert')
|
||||
axios
|
||||
.delete(`/api/subscriptions/billing-alerts/${this.user.data.relationships.alert.data.id}`)
|
||||
.delete('/api/subscriptions/billing-alert')
|
||||
.then(() => {
|
||||
this.$store.dispatch('getAppData')
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
|
||||
// Send request to get share link
|
||||
axios
|
||||
.post(`/api/upload-request`, this.form)
|
||||
.post(`/api/file-request`, this.form)
|
||||
.then((response) => {
|
||||
this.generatedUploadRequest = response.data
|
||||
})
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ const actions = {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/navigation`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/navigation`,
|
||||
Public: `/api/browse/navigation/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/browse/navigation'
|
||||
|
||||
|
||||
+5
-5
@@ -59,7 +59,7 @@ const actions = {
|
||||
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/move`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/move`,
|
||||
Public: `/api/editor/move/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/move'
|
||||
|
||||
@@ -87,7 +87,7 @@ const actions = {
|
||||
createFolder: ({ commit, getters, dispatch }, folder) => {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/create-folder`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/create-folder`,
|
||||
Public: `/api/editor/create-folder/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/create-folder'
|
||||
|
||||
@@ -126,7 +126,7 @@ const actions = {
|
||||
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/rename/${data.id}`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/rename/${data.id}`,
|
||||
Public: `/api/editor/rename/${data.id}/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || `/api/rename/${data.id}`
|
||||
|
||||
@@ -149,7 +149,7 @@ const actions = {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/upload/chunks`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/upload/chunks`,
|
||||
Public: `/api/editor/upload/chunks/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/upload/chunks'
|
||||
|
||||
@@ -319,7 +319,7 @@ const actions = {
|
||||
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/remove`,
|
||||
RequestUpload: `/api/file-request/${router.currentRoute.params.token}/remove`,
|
||||
Public: `/api/editor/remove/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/remove'
|
||||
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ const actions = {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(`/api/upload-request/${router.currentRoute.params.token}/browse/${id || 'all'}${getters.sorting.URI}`)
|
||||
.get(`/api/file-request/${router.currentRoute.params.token}/browse/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
@@ -37,7 +37,7 @@ const actions = {
|
||||
},
|
||||
getUploadRequestDetail: ({ commit }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.get(`/api/upload-request/${router.currentRoute.params.token}`)
|
||||
axios.get(`/api/file-request/${router.currentRoute.params.token}`)
|
||||
.then((response) => {
|
||||
resolve(response)
|
||||
|
||||
@@ -56,7 +56,7 @@ const actions = {
|
||||
},
|
||||
closeUploadRequest: ({ commit }) => {
|
||||
axios
|
||||
.delete(`/api/upload-request/${router.currentRoute.params.token}`)
|
||||
.delete(`/api/file-request/${router.currentRoute.params.token}`)
|
||||
.then((response) => {
|
||||
commit('LOADING_STATE', { loading: false, data: [] })
|
||||
commit('SET_UPLOAD_REQUEST', response.data)
|
||||
|
||||
Reference in New Issue
Block a user