@afeefa/vue-app 0.0.239 → 0.0.240

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.0.239
1
+ 0.0.240
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.239",
3
+ "version": "0.0.240",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@ export class ApiAction extends ApiResourcesApiAction {
11
11
  _minDuration = 100
12
12
  _startTime = 0
13
13
  _showError = true
14
+ _alert = null
14
15
 
15
16
  id (id) {
16
17
  if (id) {
@@ -99,10 +100,14 @@ export class ApiAction extends ApiResourcesApiAction {
99
100
  }
100
101
  }
101
102
 
102
- alert (message) {
103
- eventBus.dispatch(new AlertEvent(AlertEvent.MESSAGE, {
104
- message
105
- }))
103
+ alert (alert) {
104
+ this._alert = alert
105
+ return this
106
+ }
107
+
108
+ _showAlert (message) {
109
+ const alert = this._alert || {message}
110
+ eventBus.dispatch(new AlertEvent(AlertEvent.MESSAGE, alert))
106
111
  }
107
112
  }
108
113
 
@@ -19,7 +19,7 @@ export class DeleteAction extends ApiAction {
19
19
  async afterRequest () {
20
20
  await super.afterRequest()
21
21
 
22
- this.alert('Die Daten wurden gelöscht.')
22
+ this._showAlert('Die Daten wurden gelöscht.')
23
23
  }
24
24
 
25
25
  processResult () {
@@ -22,7 +22,7 @@ export class SaveAction extends ApiAction {
22
22
  const response = super.processResult(result)
23
23
 
24
24
  if (this._showSuccess) {
25
- this.alert('Die Daten wurden gespeichert.')
25
+ this._showAlert('Die Daten wurden gespeichert.')
26
26
  }
27
27
 
28
28
  return response