From c6e7390f137991a6d992ad62ddca46a07fd4bf4e Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 16 Aug 2022 21:26:54 +0000 Subject: [PATCH] fix: search for assignees by username (#2264) Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2264 --- src/components/list/partials/filters.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/list/partials/filters.vue b/src/components/list/partials/filters.vue index d2b92967..73e2711a 100644 --- a/src/components/list/partials/filters.vue +++ b/src/components/list/partials/filters.vue @@ -499,6 +499,14 @@ export default defineComponent({ if (typeof this.filters[filterName] === 'undefined' || this.filters[filterName] === '') { return } + + // Don't load things if we already have something loaded. + // This is not the most ideal solution because it prevents a re-population when filters are changed + // from the outside. It is still fine because we're not changing them from the outside, other than + // loading them initially. + if(this[kind].length > 0) { + return + } this[kind] = await this[`${servicePrefix}Service`].getAll({}, {s: this.filters[filterName]}) }, @@ -532,6 +540,7 @@ export default defineComponent({ if (query === '') { this.clear(kind) + return } const response = await this[`${kind}Service`].getAll({}, {s: query}) @@ -558,7 +567,7 @@ export default defineComponent({ let ids = [] this[kind].forEach(u => { - ids.push(u.id) + ids.push(kind === 'users' ? u.username : u.id) }) this.filters[filterName] = ids.join(',')