summaryrefslogtreecommitdiffstats
path: root/settings/src/store
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-04-14 10:34:40 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-16 09:50:22 +0200
commit45f1efe95391b09fbf3e4880eb4000f25a529ce3 (patch)
treea96168786066f22dc61feb648236c38cc94b8b05 /settings/src/store
parent2963fdc879de8c84311eae66812317e6c455ca0b (diff)
downloadnextcloud-server-45f1efe95391b09fbf3e4880eb4000f25a529ce3.tar.gz
nextcloud-server-45f1efe95391b09fbf3e4880eb4000f25a529ce3.zip
Continued the upgrade to proper router link and added navigationItem router linkTo capability
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src/store')
-rw-r--r--settings/src/store/api.js2
-rw-r--r--settings/src/store/users.js30
2 files changed, 17 insertions, 15 deletions
diff --git a/settings/src/store/api.js b/settings/src/store/api.js
index ef1ba4e56d6..b0e59918bb1 100644
--- a/settings/src/store/api.js
+++ b/settings/src/store/api.js
@@ -37,6 +37,8 @@ export default {
* .then((response) => {API success})
* .catch((error) => {throw error;});
* }).catch((error) => {requireAdmin OR API failure});
+ *
+ * @returns {Promise}
*/
requireAdmin() {
return new Promise(function(resolve, reject) {
diff --git a/settings/src/store/users.js b/settings/src/store/users.js
index cd5e2bbbaa9..6523c85037a 100644
--- a/settings/src/store/users.js
+++ b/settings/src/store/users.js
@@ -90,7 +90,7 @@ const mutations = {
enableDisableUser(state, { userid, enabled }) {
state.users.find(user => user.id == userid).enabled = enabled;
// increment or not
- state.groups.find(group => group.id == '_disabled').usercount += enabled ? -1 : 1;
+ state.groups.find(group => group.id == 'disabled').usercount += enabled ? -1 : 1;
state.userCount += enabled ? 1 : -1;
console.log(enabled);
},
@@ -144,7 +144,7 @@ const actions = {
* @param {int} options.limit List number to return from offset
* @param {string} options.search Search amongst users
* @param {string} options.group Get users from group
- * @returns {Promise}
+ * @returns Promise
*/
getUsers(context, { offset, limit, search, group }) {
search = typeof search === 'string' ? search : '';
@@ -179,7 +179,7 @@ const actions = {
* @param {Object} options
* @param {int} options.offset List offset to request
* @param {int} options.limit List number to return from offset
- * @returns {Promise}
+ * @returns Promise
*/
getUsersFromList(context, { offset, limit, search }) {
search = typeof search === 'string' ? search : '';
@@ -201,7 +201,7 @@ const actions = {
* @param {Object} options
* @param {int} options.offset List offset to request
* @param {int} options.limit List number to return from offset
- * @returns {Promise}
+ * @returns Promise
*/
getUsersFromGroup(context, { groupid, offset, limit }) {
return api.get(OC.linkToOCS(`cloud/users/${groupid}/details?offset=${offset}&limit=${limit}`, 2))
@@ -221,7 +221,7 @@ const actions = {
*
* @param {Object} context
* @param {string} gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
addGroup(context, gid) {
return api.requireAdmin().then((response) => {
@@ -236,7 +236,7 @@ const actions = {
*
* @param {Object} context
* @param {string} gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
removeGroup(context, gid) {
return api.requireAdmin().then((response) => {
@@ -253,7 +253,7 @@ const actions = {
* @param {Object} options
* @param {string} options.userid User id
* @param {string} options.gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
addUserGroup(context, { userid, gid }) {
return api.requireAdmin().then((response) => {
@@ -270,7 +270,7 @@ const actions = {
* @param {Object} options
* @param {string} options.userid User id
* @param {string} options.gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
removeUserGroup(context, { userid, gid }) {
return api.requireAdmin().then((response) => {
@@ -287,7 +287,7 @@ const actions = {
* @param {Object} options
* @param {string} options.userid User id
* @param {string} options.gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
addUserSubAdmin(context, { userid, gid }) {
return api.requireAdmin().then((response) => {
@@ -304,7 +304,7 @@ const actions = {
* @param {Object} options
* @param {string} options.userid User id
* @param {string} options.gid Group id
- * @returns {Promise}
+ * @returns Promise
*/
removeUserSubAdmin(context, { userid, gid }) {
return api.requireAdmin().then((response) => {
@@ -319,7 +319,7 @@ const actions = {
*
* @param {Object} context
* @param {string} userid User id
- * @returns {Promise}
+ * @returns Promise
*/
deleteUser(context, { userid }) {
return api.requireAdmin().then((response) => {
@@ -340,7 +340,7 @@ const actions = {
* @param {string} options.groups User groups
* @param {string} options.subadmin User subadmin groups
* @param {string} options.quota User email
- * @returns {Promise}
+ * @returns Promise
*/
addUser({context, dispatch}, { userid, password, email, groups, subadmin, quota, language }) {
return api.requireAdmin().then((response) => {
@@ -355,7 +355,7 @@ const actions = {
*
* @param {Object} context
* @param {string} userid User id
- * @returns {Promise}
+ * @returns Promise
*/
addUserData(context, userid) {
return api.requireAdmin().then((response) => {
@@ -371,7 +371,7 @@ const actions = {
* @param {Object} options
* @param {string} options.userid User id
* @param {boolean} options.enabled User enablement status
- * @returns {Promise}
+ * @returns Promise
*/
enableDisableUser(context, { userid, enabled = true }) {
let userStatus = enabled ? 'enable' : 'disable';
@@ -390,7 +390,7 @@ const actions = {
* @param {string} options.userid User id
* @param {string} options.key User field to edit
* @param {string} options.value Value of the change
- * @returns {Promise}
+ * @returns Promise
*/
setUserData(context, { userid, key, value }) {
let allowedEmpty = ['email', 'displayname'];