import apiClient from "@/lib/axiosClient";
import { API_ENDPOINTS } from "@/lib/apiEndpoints";
import { RawContentItem, ContentApiResponse } from "@/types/content";
import { mapContentItem } from "./contentService";

export type { ContentItem as WatchLaterItem } from "@/types/content";

export const watchLaterService = {
  getWatchLaterContent: (contentType: number, pageNo: number): Promise<ContentApiResponse> =>
    apiClient
      .post(API_ENDPOINTS.GET_WATCH_LATER_CONTENT, {
        content_type: contentType,
        page_no: pageNo,
      })
      .then((r) => r.data),

  mapItem: (raw: RawContentItem) => mapContentItem(raw),
};
