import axios from 'axios'
import type { Manifest, Profile } from './types'

export const api = axios.create({
  baseURL: 'http://localhost:5454' + '/api'
})

export const getProfiles = async (): Promise<Profile[]> => {
  return api.get<Profile[]>('/profiles').then((res) => res.data)
}

export const getManifest = async (id: string): Promise<Manifest> => {
  return api.get<Manifest>(`/manifest/${id}`).then((res) => res.data)
}
