import { unwrapVimpResponse, vimpClient } from '../client';
import type { VimpChannel } from '../model';

export const catalogChannelApi = async (code: string, options?: { signal?: AbortSignal }) => {
  const { signal } = options ?? {};
  const client = vimpClient;
  const endpoint = `/catalog/channel`;
  const resp = await client.post<VimpChannel[]>(endpoint, { code, time: '' }, { signal });
  const data = unwrapVimpResponse(resp);
  return data;
};
