working team update/create (still need enroll)
This commit is contained in:
@@ -107,7 +107,6 @@ export function transformTeam(record: any): Team {
|
||||
song_name: record.song_name,
|
||||
song_artist: record.song_artist,
|
||||
song_album: record.song_album,
|
||||
song_year: record.song_year,
|
||||
song_start: record.song_start,
|
||||
song_end: 0,
|
||||
song_image_url: record.song_image_url,
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
SpotifyPlaybackState,
|
||||
SpotifyPlaybackSnapshot,
|
||||
SpotifyError,
|
||||
SpotifyTrack,
|
||||
} from './types';
|
||||
|
||||
const SPOTIFY_API_BASE = 'https://api.spotify.com/v1';
|
||||
@@ -123,6 +124,11 @@ export class SpotifyWebApiClient {
|
||||
return this.request<{ id: string; display_name: string }>('/me');
|
||||
}
|
||||
|
||||
async searchTracks(query: string, limit: number = 20): Promise<{ tracks: { items: SpotifyTrack[] } }> {
|
||||
const encodedQuery = encodeURIComponent(query);
|
||||
return this.request<{ tracks: { items: SpotifyTrack[] } }>(`/search?q=${encodedQuery}&type=track&limit=${limit}`);
|
||||
}
|
||||
|
||||
updateAccessToken(accessToken: string): void {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ export interface SpotifyContextType extends SpotifyAuthState {
|
||||
capturePlaybackState: () => Promise<void>;
|
||||
resumePlaybackState: () => Promise<void>;
|
||||
clearCapturedState: () => void;
|
||||
|
||||
searchTracks: (query: string) => Promise<SpotifyTrack[]>;
|
||||
}
|
||||
|
||||
export interface PKCEState {
|
||||
|
||||
Reference in New Issue
Block a user