Add search/offset/limit parameters to group fetching

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-06-05 17:37:58 +02:00
parent 9d6aa333d4
commit 523cd0af88
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@
<input type="checkbox" :value="app.id" v-model="groupCheckedAppsData" v-on:change="setGroupLimit" class="groups-enable__checkbox checkbox" :id="prefix('groups_enable', app.id)">
<label :for="prefix('groups_enable', app.id)">Auf Gruppen beschränken</label>
<input type="hidden" class="group_select" title="Alle" value="">
<multiselect v-if="isLimitedToGroups(app)" :options="groups" :value="appGroups" @select="addGroupLimitation" @remove="removeGroupLimitation"
<multiselect v-if="isLimitedToGroups(app)" :options="groups" :value="appGroups" @select="addGroupLimitation" @remove="removeGroupLimitation" :options-limit="5"
:placeholder="t('settings', 'Limit app usage to groups')"
label="name" track-by="id" class="multiselect-vue"
:multiple="true" :close-on-select="false">

View File

@ -197,9 +197,9 @@ const actions = {
.catch((error) => context.commit('API_FAILURE', error));
},
getGroups(context) { /* { offset, limit, search } */
//search = typeof search === 'string' ? search : '';
return api.get(OC.linkToOCS(`cloud/groups`, 2)) /* ?offset=${offset}&limit=${limit}&search=${search}` */
getGroups(context, { offset, limit, search }) {
search = typeof search === 'string' ? search : '';
return api.get(OC.linkToOCS(`cloud/groups?offset=${offset}&limit=${limit}&search=${search}`, 2))
.then((response) => {
if (Object.keys(response.data.ocs.data.groups).length > 0) {
response.data.ocs.data.groups.forEach(function(group) {

View File

@ -70,7 +70,7 @@ export default {
beforeMount() {
this.$store.dispatch('getCategories');
this.$store.dispatch('getAllApps');
this.$store.dispatch('getGroups');
this.$store.dispatch('getGroups', {offset: 0, limit: -1});
this.$store.commit('setUpdateCount', this.$store.getters.getServerData.updateCount)
},
mounted() {