1
0

Refactor success and error messages

This commit is contained in:
kolaente
2021-06-22 22:07:57 +02:00
parent ab4edc17de
commit cdc805c8da
55 changed files with 219 additions and 256 deletions

View File

@ -231,7 +231,7 @@ export default {
this.linkShares = r
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
add() {
@ -248,14 +248,11 @@ export default {
this.name = ''
this.password = ''
this.showNewForm = false
this.success(
{message: 'The link share was successfully created'},
this
)
this.success({message: 'The link share was successfully created'})
this.load()
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
remove() {
@ -266,14 +263,11 @@ export default {
this.linkShareService
.delete(linkshare)
.then(() => {
this.success(
{message: 'The link share was successfully deleted'},
this
)
this.success({message: 'The link share was successfully deleted'})
this.load()
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
.finally(() => {
this.showDeleteModal = false

View File

@ -249,7 +249,7 @@ export default {
)
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
deleteSharable() {
@ -271,10 +271,10 @@ export default {
this.sharables.splice(i, 1)
}
}
this.success({message: `The ${this.shareType} was successfully deleted from the ${this.typeString}.`}, this)
this.success({message: `The ${this.shareType} was successfully deleted from the ${this.typeString}.`})
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
add(admin) {
@ -295,19 +295,16 @@ export default {
this.stuffService
.create(this.stuffModel)
.then(() => {
this.success(
{
message:
'The ' +
this.shareType +
' was successfully added.',
},
this
)
this.success({
message:
'The ' +
this.shareType +
' was successfully added.',
})
this.load()
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
toggleType(sharable) {
@ -340,18 +337,15 @@ export default {
this.$set(this.sharables[i], 'right', r.right)
}
}
this.success(
{
message:
'The ' +
this.shareType +
' right was successfully updated.',
},
this
)
this.success({
message:
'The ' +
this.shareType +
' right was successfully updated.',
})
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
find(query) {
@ -366,7 +360,7 @@ export default {
this.$set(this, 'found', response)
})
.catch((e) => {
this.error(e, this)
this.error(e)
})
},
clearAll() {