import { request } from './client.js'

export function getQueryPreview({ signal } = {}) {
  return request('/api/query-generation/preview?per=0&batch_n=0', { signal })
}

export function getLatestBoard({ signal } = {}) {
  return request('/api/query-generation/latest-singleton', { signal })
}

export function getLatestQueryDetail(queryId, { signal } = {}) {
  return request(`/api/query-generation/latest/queries/${encodeURIComponent(queryId)}`, { signal })
}

export function submitManualQueryBatch(payload, { signal } = {}) {
  return request('/api/query-batches/manual', {
    method: 'POST',
    json: payload,
    signal,
  })
}
