diff --git a/src/components/SidebarTabs/TransferOwnership.vue b/src/components/SidebarTabs/TransferOwnership.vue index 7c1528811..57004964f 100644 --- a/src/components/SidebarTabs/TransferOwnership.vue +++ b/src/components/SidebarTabs/TransferOwnership.vue @@ -44,7 +44,9 @@ :loading="loading" :options="options" :placeholder="t('forms', 'Search for a user')" - @search="asyncSearch"> + @search=" + (query) => asyncSearch(query, [SHARE_TYPES.SHARE_TYPE_USER]) + "> diff --git a/src/mixins/UserSearchMixin.js b/src/mixins/UserSearchMixin.js index c6a572223..55a5b94bc 100644 --- a/src/mixins/UserSearchMixin.js +++ b/src/mixins/UserSearchMixin.js @@ -59,14 +59,15 @@ export default { * Search for suggestions * * @param {string} query The search query to search for + * @param {number[]|undefined} shareType The type of recipient to search. */ - async asyncSearch(query) { + async asyncSearch(query, shareType) { // save query to check if valid this.query = query.trim() if (this.isValidQuery) { // already set loading to have proper ux feedback during debounce this.loading = true - this.debounceGetSuggestions(query) + this.debounceGetSuggestions(query, shareType) } }, @@ -83,12 +84,13 @@ export default { * Get suggestions * * @param {string} query the search query + * @param {number[]|undefined} shareType The type of recipient to search. */ - async getSuggestions(query) { + async getSuggestions(query, shareType) { this.loading = true // Search for all used share-types, except public link. - const shareType = this.SHARE_TYPES_USED.filter( + shareType ??= this.SHARE_TYPES_USED.filter( (type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK, )