Compare commits

...

1 Commits

Author SHA1 Message Date
pandeymangg 0ecfeb4957 fix: product cache 2024-04-26 13:41:42 +05:30
+8 -1
View File
@@ -273,6 +273,11 @@ export const createProduct = async (
select: selectProduct, select: selectProduct,
}); });
productCache.revalidate({
id: product.id,
teamId: product.teamId,
});
const devEnvironment = await createEnvironment(product.id, { const devEnvironment = await createEnvironment(product.id, {
type: "development", type: "development",
}); });
@@ -281,9 +286,11 @@ export const createProduct = async (
type: "production", type: "production",
}); });
return await updateProduct(product.id, { const updatedProduct = await updateProduct(product.id, {
environments: [devEnvironment, prodEnvironment], environments: [devEnvironment, prodEnvironment],
}); });
return updatedProduct;
} catch (error) { } catch (error) {
if (error instanceof Prisma.PrismaClientKnownRequestError) { if (error instanceof Prisma.PrismaClientKnownRequestError) {
throw new DatabaseError(error.message); throw new DatabaseError(error.message);