Wire homepage specials, product/blog pages, instant search, and the customer portal so the live pharmacy site can be managed from the dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
483 B
TypeScript
17 lines
483 B
TypeScript
import { meshkeeGet, tenantPath } from "@/lib/meshkee";
|
|
|
|
export type CommentItem = {
|
|
id?: string;
|
|
authorName?: string | null;
|
|
text?: string | null;
|
|
createdAt?: string | null;
|
|
};
|
|
|
|
export async function fetchComments(entityType: "product" | "blog", entityId: string) {
|
|
const data = await meshkeeGet<{ items?: CommentItem[] }>(
|
|
tenantPath(`/comments?entityType=${entityType}&entityId=${encodeURIComponent(entityId)}`),
|
|
{ items: [] },
|
|
);
|
|
return data.items ?? [];
|
|
}
|