From 3cca756d352aee4ef40d8a3eed5fd0eb7c0f54de Mon Sep 17 00:00:00 2001 From: abdelillah Date: Sat, 28 May 2022 01:24:21 +0200 Subject: [PATCH] Revert "search" This reverts commit db069db32bdc05e4683549ed2a8715e6f26b0315. --- src/playlists/playlists.service.ts | 2 -- src/tracks/tracks.service.ts | 18 +++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/playlists/playlists.service.ts b/src/playlists/playlists.service.ts index c0aa722..7a0b18b 100644 --- a/src/playlists/playlists.service.ts +++ b/src/playlists/playlists.service.ts @@ -45,7 +45,6 @@ export class PlaylistsService { const playlist = new this.playlistModel(createPlaylist); const savedPlaylist = await playlist.save(); - this.playlistsSearchService.insertIndex(savedPlaylist); return savedPlaylist; } @@ -153,7 +152,6 @@ export class PlaylistsService { throw new Error("Can't delete playlist"); } - this.playlistsSearchService.deleteIndex(id); return { id: playlist._id.toString(), title: playlist.title, diff --git a/src/tracks/tracks.service.ts b/src/tracks/tracks.service.ts index adb2991..8bd24a3 100644 --- a/src/tracks/tracks.service.ts +++ b/src/tracks/tracks.service.ts @@ -208,9 +208,6 @@ export class TracksService { }, }, }, - { - $project: { id: '$_id', username: '$username', email: '$email' }, - } ], as: 'author', }, @@ -233,9 +230,6 @@ export class TracksService { $expr: ['$$track_id', '$tracks'], }, }, - { - $project: { id: '$_id', title: '$title' }, - }, ], as: 'release', }, @@ -244,14 +238,20 @@ export class TracksService { $project: { id: '$_id', title: 1, - fileName: 1, feats: { id: '$_id', username: 1, email: 1, }, - release: { $arrayElemAt: ['$release', 0] }, - author: { $arrayElemAt: ['$author', 0] }, + release: { + id: '$_id', + title: 1, + }, + author: { + id: '$_id', + username: 1, + email: 1, + }, }, }, ]);