1
0
Fork 0
mirror of synced 2024-09-28 15:21:28 +12:00

Review comments.

This commit is contained in:
mike12345567 2022-01-31 14:16:03 +00:00
parent 35aef89661
commit b84b34d5ae
2 changed files with 18 additions and 18 deletions

View file

@ -38,12 +38,16 @@ exports.updateRelatedFormula = async (appId, table, enrichedRows) => {
}
}
for (let tableId of table.relatedFormula) {
let relatedTable
try {
// no rows to update, skip
if (!relatedRows[tableId] || relatedRows[tableId].length === 0) {
continue
}
const relatedTable = await db.get(tableId)
relatedTable = await db.get(tableId)
} catch (err) {
// no error scenario, table doesn't seem to exist anymore, ignore
}
for (let column of Object.values(relatedTable.schema)) {
// needs updated in related rows
if (
@ -60,9 +64,6 @@ exports.updateRelatedFormula = async (appId, table, enrichedRows) => {
)
}
}
} catch (err) {
// no error scenario, table doesn't seem to exist anymore, ignore
}
}
}
await Promise.all(promises)

View file

@ -37,7 +37,6 @@ function getFormulaThatUseColumn(table, columnNames) {
* This functions checks for when a related table, column or related column is deleted, if any
* tables need to have the formula column removed.
*/
async function checkIfFormulaNeedsCleared(
appId,
table,