30 lines
699 B
TypeScript
Executable File
30 lines
699 B
TypeScript
Executable File
import { api } from "./client";
|
|
|
|
export interface Band {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
genre_tags: string[];
|
|
nc_folder_path: string | null;
|
|
created_at: string;
|
|
updated_at: string;
|
|
memberships?: BandMembership[];
|
|
}
|
|
|
|
export interface BandMembership {
|
|
member: { id: string; email: string; display_name: string };
|
|
role: string;
|
|
instrument: string | null;
|
|
joined_at: string;
|
|
}
|
|
|
|
export const listBands = () => api.get<Band[]>("/bands");
|
|
export const getBand = (bandId: string) => api.get<Band>(`/bands/${bandId}`);
|
|
|
|
export const createBand = (data: {
|
|
name: string;
|
|
slug: string;
|
|
genre_tags?: string[];
|
|
nc_base_path?: string;
|
|
}) => api.post<Band>("/bands", data);
|