import { publicApi } from './http'

export async function fetchScreenshots(params = {}) {
  const { data } = await publicApi.get('/screenshots', { params })
  return data
}

export async function deleteScreenshot(filename) {
  const { data } = await publicApi.delete(`/screenshots/${encodeURIComponent(filename)}`)
  return data
}

export async function clearScreenshots() {
  const { data } = await publicApi.post('/screenshots/clear', {})
  return data
}
