mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-09 08:09:46 -06:00
Fix product service throwing validation error (#658)
This commit is contained in:
@@ -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<TProduct> => {
|
||||
let productPrisma;
|
||||
try {
|
||||
@@ -19,6 +34,7 @@ export const getProductByEnvironmentId = cache(async (environmentId: string): Pr
|
||||
},
|
||||
},
|
||||
},
|
||||
select: selectProduct,
|
||||
});
|
||||
|
||||
if (!productPrisma) {
|
||||
|
||||
@@ -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"]),
|
||||
|
||||
Reference in New Issue
Block a user