diff --git a/View/Elements/ActAsPeopleAutocomplete.ctp b/View/Elements/ActAsPeopleAutocomplete.ctp
index 4e650f9..2769d92 100644
--- a/View/Elements/ActAsPeopleAutocomplete.ctp
+++ b/View/Elements/ActAsPeopleAutocomplete.ctp
@@ -101,7 +101,8 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : '';
data() {
return {
loading: false,
- rawData: []
+ rawData: [],
+ action: "enableActAs"
}
},
components: {
@@ -112,7 +113,7 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : '';
methods: {
async addUser(user) {
const { identifier: ident, label, value: id } = user;
- this.loading = true;
+ this.loading = true
// Create form
const formData = new FormData();
@@ -141,17 +142,25 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : '';
if (!resp.ok) {
generateFlash('Enabling ActAs User failed', 'error');
let errorResponse = await resp.json();
+ this.loading = false
generateFlash(`${errorResponse.message}`, 'error');
- this.loading = false;
return
}
this.rawData = await resp.json();
- console.log(this.rawData)
this.loading = false
+
// Force reload here
window.location.reload();
},
- }
+ },
+ template: `
+
+ addUser(item)"
+ :action="action"
+ :forceDisableBtn="loading"
+ icon=""/>
+ `
});
@@ -164,10 +173,5 @@ $suffix = Configure::read('debug') > 0 ? '?time=' . time() : '';
app.mount("#= $htmlId ?>-container");
-
-
addUser(item)"
- action="enableActAs"
- :activeBtn="loading"
- icon=""/>
-
-
+
+
diff --git a/View/Elements/ActionItem.ctp b/View/Elements/ActionItem.ctp
index 518ef4d..fe8719f 100644
--- a/View/Elements/ActionItem.ctp
+++ b/View/Elements/ActionItem.ctp
@@ -4,7 +4,7 @@ $vv_act_as_people = $vv_act_as_people ?? [];
?>