Fix TopNav prisma error

This commit is contained in:
Francis Cao committed 2026-08-06 09:20:27 -07:00
1 parent 8d6943bf51
commit 92fd4b71c3
3 files changed
+91 -4

No files matched your search

+5
View File
@@ -4,6 +4,7 @@ import prisma from '@/lib/prisma';
import redis from '@/lib/redis';
import { sanitizeSortFilters } from '@/lib/sort';
import type { QueryFilters } from '@/lib/types';
import { z } from 'zod';
const WEBSITE_SORT_FIELDS = ['name', 'domain', 'createdAt'] as const;
@@ -12,6 +13,10 @@ export async function findWebsite(criteria: Prisma.WebsiteFindUniqueArgs) {
}
export async function getWebsite(websiteId: string) {
if (!z.uuid().safeParse(websiteId).success) {
return null;
}
const website = await findWebsite({
where: {
id: websiteId,