import api from "@/lib/api-client"; import { IPage } from "@/features/page/types/page.types"; import { ICreateShare, IShare, ISharedItem, ISharedPage, ISharedPageTree, IShareForPage, IShareInfoInput, IUpdateShare, } from "@/features/share/types/share.types.ts"; import { IPagination, QueryParams } from "@/lib/types.ts"; export async function getShares( params?: QueryParams, ): Promise> { const req = await api.post("/shares", params); return req.data; } export async function createShare(data: ICreateShare): Promise { const req = await api.post("/shares/create", data); return req.data; } export async function getShareInfo(shareId: string): Promise { const req = await api.post("/shares/info", { shareId }); return req.data; } export async function updateShare(data: IUpdateShare): Promise { const req = await api.post("/shares/update", data); return req.data; } export async function getShareForPage(pageId: string): Promise { const req = await api.post("/shares/for-page", { pageId }); return req.data; } export async function getSharePageInfo( shareInput: Partial, ): Promise { const req = await api.post("/shares/page-info", shareInput); return req.data; } export async function deleteShare(shareId: string): Promise { await api.post("/shares/delete", { shareId }); } export async function getSharedPageTree( shareId: string, ): Promise { const req = await api.post("/shares/tree", { shareId }); return req.data; }