From 34a9b5f29749808a0cd7907e7acd9deb229d1b0c Mon Sep 17 00:00:00 2001 From: Karen Mkrtumyan Date: Sun, 8 Jun 2025 14:25:01 +0400 Subject: [PATCH] Fix are fields compatible (#484) --- src/utils/utils.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index a625260..f4036bb 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -43,14 +43,12 @@ export function isFunction(str) { return /\w+\([^)]*\)$/.test(str); } -export function areFieldsCompatible(db, field1, field2) { - const same = field1.type === field2.type; - if (dbToTypes[db][field1.type].compatibleWith) { - return ( - dbToTypes[db][field1.type].compatibleWith.includes(field2.type) || same - ); - } - return same; +export function areFieldsCompatible(db, field1Type, field2Type) { + const same = field1Type === field2Type; + const isCompatible = + dbToTypes[db][field1Type].compatibleWith && + dbToTypes[db][field1Type].compatibleWith.includes(field2Type); + return same || isCompatible; } export function getTableHeight(table) {