We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6c400e commit 1063504Copy full SHA for 1063504
src/routes/api/top-tracks/index.json.ts
@@ -1,7 +1,27 @@
1
-import { getTopTracks } from '$lib/utils/spotify';
+import type { ITopTrack } from '$models/interfaces/itop-track.interface';
2
+import { getTopTracks } from '$utils/spotify';
3
4
/** @type {import('@sveltejs/kit').RequestHandler} */
-export async function get({ query }) {
5
+export async function get({
6
+ query,
7
+}: {
8
+ query: URLSearchParams;
9
+}): Promise<
10
+ | {
11
+ status: number;
12
+ headers?: {
13
+ [key: string]: string;
14
+ };
15
+ body?: string;
16
+ }
17
18
19
+ headers: {
20
21
22
+ body: ITopTrack[];
23
24
+> {
25
const limit = Number(query.get('limit') ?? 10);
26
27
if (Number.isNaN(limit)) {
0 commit comments