import api from './api'; import type { Artist, ArtistWithAlbums } from '../types'; export interface ListArtistsParams { limit?: number; offset?: number; } export const artistService = { // GET /api/artists async listArtists(params?: ListArtistsParams): Promise { const res = await api.get('/artists', { params }); return res.data; }, // GET /api/artists/:id (returns artist + albums) async getArtist(id: string): Promise { const res = await api.get(`/artists/${id}`); return res.data; }, // POST /api/artists async createArtist(data: Partial): Promise { const res = await api.post('/artists', data); return res.data; }, // PUT /api/artists/:id async updateArtist(id: string, data: Partial): Promise { const res = await api.put(`/artists/${id}`, data); return res.data; }, // DELETE /api/artists/:id async deleteArtist(id: string): Promise<{ status: string }> { const res = await api.delete<{ status: string }>(`/artists/${id}`); return res.data; }, };