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, + }, }, }, ]);