fix: handle undefined slug and doctorId in cache functions

This commit is contained in:
hamed
2026-07-07 11:47:44 +03:30
parent df7fbb7530
commit 73c10f53ec
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ import { imageUrl } from "@/helper";
const API_URL = process.env.NEXT_PUBLIC_API_URL;
const getClinic = cache(async (slug) => {
if (!slug || slug === "undefined") return null;
const res = await fetch(`${API_URL}/api/v1/clinic/${slug}`, {
next: { revalidate: 3600, tags: [`clinic-${slug}`] },
});