|
|
@@ -603,7 +603,13 @@ export class OrderModifier {
|
|
|
|
|
|
for (const def of customFieldDefs) {
|
|
|
const key = def.name;
|
|
|
- const existingValue = existingCustomFields?.[key];
|
|
|
+ // This ternary is there because with the MySQL driver, boolean customFields with a default
|
|
|
+ // of `false` were being rep-resented as `0`, thus causing the equality check to fail.
|
|
|
+ // So if it's a boolean, we'll explicitly coerce the value to a boolean.
|
|
|
+ const existingValue =
|
|
|
+ def.type === 'boolean' && typeof existingCustomFields?.[key] === 'number'
|
|
|
+ ? !!existingCustomFields?.[key]
|
|
|
+ : existingCustomFields?.[key];
|
|
|
if (existingValue !== undefined) {
|
|
|
const valuesMatch =
|
|
|
JSON.stringify(inputCustomFields?.[key]) === JSON.stringify(existingValue);
|