Skip to content

Commit d72d69c

Browse files
Added the proper types to the now-playing endpoint function
1 parent b6b9600 commit d72d69c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/routes/api/now-playing/index.json.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
import type { INowPlayingTrack } from '$models/interfaces/inow-playing-track.interface';
12
import { getNowPlaying } from '$utils/spotify';
23

3-
/** @type {import('@sveltejs/kit').RequestHandler} */
4-
export async function get({ query }) {
4+
/** @type {import('@sveltejs/kit').Page} */
5+
export async function get(): Promise<{
6+
status: number;
7+
body: INowPlayingTrack;
8+
headers?: {
9+
[key: string]: string;
10+
};
11+
}> {
512
const response = await getNowPlaying();
613

714
if (response.status === 204 || response.status > 400) {

0 commit comments

Comments
 (0)