import { api } from './http';

export interface UploadedImage {
  url: string;
  name: string;
  size: number;
  mime: string;
}

export const ImageAPI = {
  upload: (files: File[]) => {
    const fd = new FormData();
    files.forEach((f) => fd.append('file', f));
    return api.post<{ files: UploadedImage[] }>('/uploads/image', fd).then((r) => r.data);
  }
};

