Browse Source

fix: missing return

pull/9683/head
Pranav C 1 month ago
parent
commit
323c5b9a05
  1. 2
      packages/nc-gui/utils/dataUtils.ts
  2. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts

2
packages/nc-gui/utils/dataUtils.ts

@ -29,7 +29,7 @@ export const extractPkFromRow = (row: Record<string, any>, columns: ColumnType[]
const pkCols = columns.filter((c: Required<ColumnType>) => c.pk) const pkCols = columns.filter((c: Required<ColumnType>) => c.pk)
// if multiple pk columns, join them with ___ and escape _ in id values with \_ to avoid conflicts // if multiple pk columns, join them with ___ and escape _ in id values with \_ to avoid conflicts
if (pkCols.length > 1) { if (pkCols.length > 1) {
pkCols.map((c: Required<ColumnType>) => row?.[c.title]?.toString?.().replaceAll('_', '\\_') ?? null).join('___') return pkCols.map((c: Required<ColumnType>) => row?.[c.title]?.toString?.().replaceAll('_', '\\_') ?? null).join('___')
} else if (pkCols.length) { } else if (pkCols.length) {
return row?.[pkCols[0].title] ?? null return row?.[pkCols[0].title] ?? null
} }

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -10230,7 +10230,7 @@ export function getCompositePkValue(primaryKeys: Column[], row) {
if (typeof row !== 'object') return row; if (typeof row !== 'object') return row;
if (primaryKeys.length > 1) { if (primaryKeys.length > 1) {
primaryKeys.map((c) => return primaryKeys.map((c) =>
(row[c.title] ?? row[c.column_name])?.toString?.().replaceAll('_', '\\_'), (row[c.title] ?? row[c.column_name])?.toString?.().replaceAll('_', '\\_'),
); );
} }

Loading…
Cancel
Save