-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat: song search #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
ae21b6e
3b884ca
bc9e322
9de7c27
a9742d8
ca60eee
18a42ac
db6bdec
a41de9a
b075679
1180fa3
29dda31
6fedc00
1797c10
ce8d89d
37dabb0
4fcf74f
9cf07b7
ca028ec
e96f8d5
a5d8d40
713b113
d436c81
d8b0951
dee73e2
47409c5
f9aa95e
8609519
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,17 +7,14 @@ import { HomePageComponent } from '@web/modules/browse/components/HomePageCompon | |
|
|
||
| async function fetchRecentSongs() { | ||
| try { | ||
| const response = await axiosInstance.get<SongPreviewDto[]>( | ||
| '/song-browser/recent', | ||
| { | ||
| params: { | ||
| page: 1, // TODO: fiz constants | ||
| limit: 16, // TODO: change 'limit' parameter to 'skip' and load 12 songs initially, then load 8 more songs on each pagination | ||
| sort: 'recent', | ||
| order: false, | ||
| }, | ||
| const response = await axiosInstance.get<SongPreviewDto[]>('/song', { | ||
| params: { | ||
| page: 1, // TODO: fix constants | ||
| limit: 16, // TODO: change 'limit' parameter to 'skip' and load 12 songs initially, then load 8 more songs on each pagination | ||
| sort: 'recent', | ||
| order: 'desc', | ||
| }, | ||
| ); | ||
| }); | ||
|
|
||
| return response.data; | ||
| } catch (error) { | ||
|
|
@@ -28,9 +25,8 @@ async function fetchRecentSongs() { | |
| async function fetchFeaturedSongs(): Promise<FeaturedSongsDto> { | ||
| try { | ||
| const response = await axiosInstance.get<FeaturedSongsDto>( | ||
| '/song-browser/featured', | ||
| '/song/featured', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this route supposed to clash with the Our song IDs are 10 characters long, spanning |
||
| ); | ||
|
|
||
| return response.data; | ||
| } catch (error) { | ||
| return { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this part of the code be extracted outside of the
ifclause? It's repeated exactly for each query mode :)EDIT: I mean the
return new PageDto({...})part. For some reason I highlighted completely wrong lines.