Merge pull request #378 from YunoHost/enh-filter-by-groups

[enh] Filter by groups
This commit is contained in:
Alexandre Aubin 2021-09-05 17:40:52 +02:00 committed by GitHub
commit 91f89815f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export default {
data () { data () {
return { return {
queries: [ queries: [
['GET', { uri: 'users' }] ['GET', { uri: 'users?fields=username&fields=fullname&fields=mail&fields=mailbox-quota&fields=groups' }]
], ],
search: '' search: ''
} }
@ -61,7 +61,7 @@ export default {
if (!this.users) return if (!this.users) return
const search = this.search.toLowerCase() const search = this.search.toLowerCase()
const filtered = this.users.filter(user => { const filtered = this.users.filter(user => {
return user.username.toLowerCase().includes(search) return user.username.toLowerCase().includes(search) || user.groups.includes(search)
}) })
return filtered.length === 0 ? null : filtered return filtered.length === 0 ? null : filtered
} }