Decode id if needed

This commit is contained in:
Mel O'Hagan 2022-10-27 16:28:26 +01:00
parent 36801cc928
commit 4403b2fb22
1 changed files with 5 additions and 1 deletions

View File

@ -282,8 +282,12 @@ module External {
const linkTablePrimary = linkTable.primary[0]
// one to many
if (isOneSide(field)) {
let id = row[key][0]
if (isNaN(id)) {
id = decodeURIComponent(row[key]).match(/\[(.*?)\]/)?.[1]
}
newRow[field.foreignKey || linkTablePrimary] = breakRowIdField(
row[key][0]
id
)[0]
}
// many to many