Merge pull request #9750 from Budibase/fix/9749
Static formula document conflict issue
This commit is contained in:
commit
fcaf03fbb8
1 changed files with 7 additions and 1 deletions
|
@ -38,7 +38,13 @@ export async function updateRelatedFormula(
|
||||||
if (!relatedRows[relatedTableId]) {
|
if (!relatedRows[relatedTableId]) {
|
||||||
relatedRows[relatedTableId] = []
|
relatedRows[relatedTableId] = []
|
||||||
}
|
}
|
||||||
relatedRows[relatedTableId] = relatedRows[relatedTableId].concat(field)
|
// filter down to the rows which are not already included in related
|
||||||
|
const currentIds = relatedRows[relatedTableId].map(row => row._id)
|
||||||
|
const uniqueRelatedRows = field.filter(
|
||||||
|
(row: Row) => !currentIds.includes(row._id)
|
||||||
|
)
|
||||||
|
relatedRows[relatedTableId] =
|
||||||
|
relatedRows[relatedTableId].concat(uniqueRelatedRows)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let tableId of table.relatedFormula) {
|
for (let tableId of table.relatedFormula) {
|
||||||
|
|
Loading…
Reference in a new issue