diff --git a/resources/js/components/Spotlight/Spotlight.vue b/resources/js/components/Spotlight/Spotlight.vue index ed3e5e0c..1611e567 100644 --- a/resources/js/components/Spotlight/Spotlight.vue +++ b/resources/js/components/Spotlight/Spotlight.vue @@ -898,18 +898,7 @@ export default { params: { query: value }, }) .then((response) => { - // Show user result - if (this.activeFilter === 'users') { - this.results = response.data - } - - // Show file result - if (!this.activeFilter) { - let files = response.data.files - let folders = response.data.folders - - this.results = folders.concat(files) - } + this.results = response.data.data }) .catch(() => this.$isSomethingWrong()) .finally(() => (this.isLoading = false)) diff --git a/resources/js/views/Admin/Users/UserTabs/UserFixedSubscription.vue b/resources/js/views/Admin/Users/UserTabs/UserFixedSubscription.vue index 6170b28a..805d82df 100644 --- a/resources/js/views/Admin/Users/UserTabs/UserFixedSubscription.vue +++ b/resources/js/views/Admin/Users/UserTabs/UserFixedSubscription.vue @@ -73,7 +73,7 @@ export default { this.limitations.push({ message: payload.message[key], - isVisibleBar: item.total === -1, + isVisibleBar: item.total !== -1 && item.total !== 0, distribution: [ { progress: item.percentage, diff --git a/src/Domain/Browsing/Controllers/SpotlightSearchController.php b/src/Domain/Browsing/Controllers/SpotlightSearchController.php index 69d5e827..f253b5ea 100644 --- a/src/Domain/Browsing/Controllers/SpotlightSearchController.php +++ b/src/Domain/Browsing/Controllers/SpotlightSearchController.php @@ -96,10 +96,14 @@ class SpotlightSearchController ->get() ->take(3); + $entries = collect([ + $folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null, + $files ? json_decode((new FilesCollection($files))->toJson(), true) : null, + ])->collapse(); + // Collect folders and files to single array return response()->json([ - 'folders' => new FolderCollection($folders), - 'files' => new FilesCollection($files), + 'data' => $entries, ]); } }