api refactoring

This commit is contained in:
Čarodej
2022-05-11 09:19:55 +02:00
parent d2371e667f
commit c0e431b384
76 changed files with 1142 additions and 690 deletions

View File

@@ -50,7 +50,7 @@ export default {
reader.readAsDataURL(file)
// Update user avatar
this.$updateImage('/user/settings', 'avatar', event.target.files[0])
this.$updateAvatar(event.target.files[0])
} else {
alert(this.$t('wrong_image_error'))
}

View File

@@ -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'

View File

@@ -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')

View File

@@ -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
})