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 LikedItem } from "@/types/content";

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

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