aboutsummaryrefslogtreecommitdiffstats
path: root/settings/src/store/users.js
diff options
context:
space:
mode:
Diffstat (limited to 'settings/src/store/users.js')
-rw-r--r--settings/src/store/users.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/settings/src/store/users.js b/settings/src/store/users.js
index 142bc222b8b..1a8d6ac6ea4 100644
--- a/settings/src/store/users.js
+++ b/settings/src/store/users.js
@@ -41,7 +41,7 @@ const defaults = {
usercount: 0,
disabled: 0
}
-}
+};
const state = {
users: [],
@@ -395,7 +395,7 @@ const actions = {
* @param {string} userid User id
* @returns {Promise}
*/
- deleteUser(context, { userid }) {
+ deleteUser(context, userid) {
return api.requireAdmin().then((response) => {
return api.delete(OC.linkToOCS(`cloud/users/${userid}`, 2))
.then((response) => context.commit('deleteUser', userid))
@@ -484,6 +484,21 @@ const actions = {
}
}
return Promise.reject(new Error('Invalid request data'));
+ },
+
+ /**
+ * Send welcome mail
+ *
+ * @param {Object} context
+ * @param {string} userid User id
+ * @returns {Promise}
+ */
+ sendWelcomeMail(context, userid) {
+ return api.requireAdmin().then((response) => {
+ return api.post(OC.linkToOCS(`cloud/users/${userid}/welcome`, 2))
+ .then(response => true)
+ .catch((error) => {throw error;});
+ }).catch((error) => context.commit('API_FAILURE', { userid, error }));
}
};