Bookmark
Users can bookmark collections via PAKT SDK
Create a bookmark
type createBookMarkDto = {
collection: string;
};
interface ICollectionBookmarkDto {
_id?: string;
owner: string; //TODO :: add IUserDto
data: ICollectionDto | string;
active: boolean;
isDeleted?: boolean;
}
export const createBookmark = async (collection: string) => {
const payload: createBookMarkDto = {
collection,
};
const create: ICollectionBookmarkDto = await sdkInit.bookmark.create();
};
Get bookmarks
type filterBookmarkDto = {
page?: string;
limit?: string;
}
| ICollectionBookmarkDto;
interface FindCollectionBookMarkDto = {
page: number;
pages: number;
total: number;
limit: number;
data: ICollectionBookmarkDto[];
};
export const getBookmarks = async (filter?: filterBookmarkDto) => {
const bookmarks: FindCollectionBookMarkDto = await sdkInit.bookmark.getAll(filter);
};
Get a bookmark
export const getABookmark = async (id: string, filter?: Record<string, any> | ICollectionBookmarkDto) => {
const aBookmark: ICollectionBookmarkDto = await sdkInit.bookmark.getById(id, filter);
};
Delete a bookmark
export const deleteABookmark = async (id: string) => {
const resp: any = await sdkInit.bookmark.delete(id);
};
Last updated