Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
Homework_89_Tsoy_Danil
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Цой Данил
Homework_89_Tsoy_Danil
Commits
9db8c85c
Commit
9db8c85c
authored
Mar 16, 2023
by
Цой Данил
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4
added extra task to track part task
parent
c24e5de2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
tracksService.ts
src/services/tracksService.ts
+3
-0
No files found.
src/services/tracksService.ts
View file @
9db8c85c
...
...
@@ -3,6 +3,7 @@ import { EStatuses } from "../enum/EStatuses";
import
IResponse
from
"../interfaces/IResponse"
;
import
ITrack
from
"../interfaces/ITrack"
;
import
ITrackDto
from
"../interfaces/ITrackDto"
;
import
{
Album
}
from
"../models/Album"
;
import
{
Track
}
from
"../models/Track"
;
...
...
@@ -13,6 +14,8 @@ export class TracksService {
let
data
if
(
req
.
query
.
album
){
data
=
await
Track
.
find
({
album
:
req
.
query
.
album
}).
populate
(
'album'
)
}
else
if
(
req
.
query
.
artist
){
data
=
await
Track
.
find
({
album
:
await
Album
.
find
({
artist
:
req
.
query
.
artist
})}).
populate
(
'album'
)
}
else
{
data
=
await
Track
.
find
().
populate
(
'album'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment