Browse Source

refactor: reenabled song searching in admin pages

Kristian Vos 5 years ago
parent
commit
8ea4178a5d
2 changed files with 12 additions and 4 deletions
  1. 6 2
      frontend/components/Admin/QueueSongs.vue
  2. 6 2
      frontend/components/Admin/Songs.vue

+ 6 - 2
frontend/components/Admin/QueueSongs.vue

@@ -122,8 +122,12 @@ export default {
 	},
 	computed: {
 		filteredSongs() {
-			return this.songs;
-			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
+			return this.songs.filter(
+				song =>
+					JSON.stringify(Object.values(song)).indexOf(
+						this.searchQuery
+					) !== -1
+			);
 		},
 		...mapState("modals", {
 			modals: state => state.modals.admin

+ 6 - 2
frontend/components/Admin/Songs.vue

@@ -112,8 +112,12 @@ export default {
 	},
 	computed: {
 		filteredSongs() {
-			return this.songs;
-			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
+			return this.songs.filter(
+				song =>
+					JSON.stringify(Object.values(song)).indexOf(
+						this.searchQuery
+					) !== -1
+			);
 		},
 		...mapState("modals", {
 			modals: state => state.modals.admin