api refactoring

This commit is contained in:
Čarodej
2022-05-31 15:12:31 +02:00
parent a4b18c26b5
commit 7659cc7221
9 changed files with 38 additions and 18 deletions

View File

@@ -213,6 +213,7 @@ export default {
isExpiration: false,
isEmailSharing: false,
shareOptions: {
id: undefined,
isPassword: undefined,
expiration: undefined,
password: undefined,
@@ -244,7 +245,7 @@ export default {
// Send request to get share link
axios
.post(`/api/share/${this.id}`, this.shareOptions)
.post('/api/share', this.shareOptions)
.then((response) => {
// End loading
this.isGeneratedShared = true
@@ -278,18 +279,18 @@ export default {
this.pickedItem = args.item
this.shareOptions.type = args.item.data.type
this.id = args.item.data.id
this.shareOptions.id = args.item.data.id
})
// Close popup
events.$on('popup:close', () => {
// Restore data
setTimeout(() => {
this.id = undefined
this.isGeneratedShared = false
this.isExpiration = false
this.isEmailSharing = false
this.shareOptions = {
id: undefined,
isPassword: false,
expiration: undefined,
password: undefined,