Skip to content

Commit 6bb502e

Browse files
committed
refactor: remove unused endpoint state variable in RecentSongsContext
1 parent 8fd4429 commit 6bb502e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

apps/frontend/src/modules/browse/components/client/context/RecentSongs.context.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ interface RecentSongsState {
1414
selectedCategory: string;
1515
categories: Record<string, number>;
1616
page: number;
17-
endpoint: string;
1817
}
1918

2019
interface RecentSongsActions {
@@ -39,7 +38,6 @@ export const useRecentSongsStore = create<RecentSongsStore>((set, get) => ({
3938
selectedCategory: '',
4039
categories: {},
4140
page: 0,
42-
endpoint: '/song',
4341

4442
// Actions
4543
initialize: (initialRecentSongs) => {
@@ -66,7 +64,7 @@ export const useRecentSongsStore = create<RecentSongsStore>((set, get) => ({
6664
},
6765

6866
fetchRecentSongs: async () => {
69-
const { page, endpoint, selectedCategory } = get();
67+
const { page, selectedCategory } = get();
7068
set({ isLoading: true });
7169

7270
try {
@@ -84,7 +82,7 @@ export const useRecentSongsStore = create<RecentSongsStore>((set, get) => ({
8482
}
8583

8684
const response = await axiosInstance.get<PageDto<SongPreviewDtoType>>(
87-
endpoint,
85+
'/song',
8886
{ params },
8987
);
9088

@@ -120,7 +118,6 @@ export const useRecentSongsStore = create<RecentSongsStore>((set, get) => ({
120118
page: 1,
121119
recentSongs: Array(12).fill(null),
122120
hasMore: true,
123-
endpoint: '/song', // Always '/song' regardless of category
124121
});
125122
},
126123

0 commit comments

Comments
 (0)