fix: handle undefined slug and doctorId in cache functions
This commit is contained in:
@@ -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}`] },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user