diff --git a/packages/lib/services/product.ts b/packages/lib/services/product.ts index 12451da4e9..9f55d8cc19 100644 --- a/packages/lib/services/product.ts +++ b/packages/lib/services/product.ts @@ -8,6 +8,21 @@ import { ZProduct } from "@formbricks/types/v1/product"; import type { TProduct } from "@formbricks/types/v1/product"; import { cache } from "react"; +const selectProduct = { + id: true, + createdAt: true, + updatedAt: true, + name: true, + teamId: true, + brandColor: true, + highlightBorderColor: true, + recontactDays: true, + formbricksSignature: true, + placement: true, + clickOutsideClose: true, + darkOverlay: true, +}; + export const getProductByEnvironmentId = cache(async (environmentId: string): Promise => { let productPrisma; try { @@ -19,6 +34,7 @@ export const getProductByEnvironmentId = cache(async (environmentId: string): Pr }, }, }, + select: selectProduct, }); if (!productPrisma) { diff --git a/packages/types/v1/product.ts b/packages/types/v1/product.ts index 2e49f638ee..9383e22f7c 100644 --- a/packages/types/v1/product.ts +++ b/packages/types/v1/product.ts @@ -10,7 +10,7 @@ export const ZProduct = z.object({ highlightBorderColor: z .string() .regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/) - .nullable(), + .nullish(), recontactDays: z.number().int(), formbricksSignature: z.boolean(), placement: z.enum(["bottomLeft", "bottomRight", "topLeft", "topRight", "center"]),