mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
Compare commits
1 Commits
ReviewBot/
...
ReviewBot/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40df928974 |
@@ -22,7 +22,7 @@ type UnifiedStylingProps = {
|
||||
product: TProduct;
|
||||
};
|
||||
|
||||
const COLOR_DEFAULTS = {
|
||||
const colorDefaults = {
|
||||
brandColor: "#64748b",
|
||||
questionColor: "#2b2524",
|
||||
inputColor: "#efefef",
|
||||
|
||||
@@ -15,37 +15,37 @@ async function main() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (products.length) {
|
||||
for (const product of products) {
|
||||
if (product.styling !== null) {
|
||||
// styling object already exists for this product
|
||||
continue;
|
||||
}
|
||||
|
||||
const styling: TStyling = {
|
||||
unifiedStyling: true,
|
||||
allowStyleOverwrite: true,
|
||||
brandColor: {
|
||||
light: product.brandColor,
|
||||
},
|
||||
...(product.highlightBorderColor && {
|
||||
highlightBorderColor: {
|
||||
light: product.highlightBorderColor,
|
||||
dark: product.highlightBorderColor,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
await tx.product.update({
|
||||
where: {
|
||||
id: product.id,
|
||||
},
|
||||
data: {
|
||||
styling,
|
||||
},
|
||||
});
|
||||
const updates = products.map(product => {
|
||||
if (product.styling !== null) {
|
||||
// styling object already exists for this product
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const styling: TStyling = {
|
||||
unifiedStyling: true,
|
||||
allowStyleOverwrite: true,
|
||||
brandColor: {
|
||||
light: product.brandColor,
|
||||
},
|
||||
...(product.highlightBorderColor && {
|
||||
highlightBorderColor: {
|
||||
light: product.highlightBorderColor,
|
||||
dark: product.highlightBorderColor,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
return tx.product.update({
|
||||
where: {
|
||||
id: product.id,
|
||||
},
|
||||
data: {
|
||||
styling,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
await tx.$transaction(updates);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user