import httpClient from "@/services/httpClient";
import type { Response } from "@/types/response.types"
import type { ChapterSearchRequest, ChapterSearchResponse } from "@/types/search.types";
import * as urlHelper from "@/libs/url.lib"

const _url = urlHelper.withPrefix("/gw/search/chapter/search")

export async function search(request: ChapterSearchRequest): Promise<ChapterSearchResponse> {
  const resp = await httpClient.post<Response<ChapterSearchResponse>>(_url(), request);
  return resp.data.data;
}
