Refactor success and error messages
This commit is contained in:
@ -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
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user