Refactor.

This commit is contained in:
mike12345567 2021-12-03 10:31:09 +00:00
parent 560a96b503
commit 71e93a20a1
1 changed files with 4 additions and 4 deletions

View File

@ -91,11 +91,11 @@ exports.exportView = async ctx => {
const relationships = Object.entries(schema) const relationships = Object.entries(schema)
.filter(entry => entry[1].type === FieldTypes.LINK) .filter(entry => entry[1].type === FieldTypes.LINK)
.map(entry => entry[0]) .map(entry => entry[0])
rows.forEach(row => { // iterate relationship columns and remove from and row and schema
relationships.forEach(column => delete row[column])
})
// delete relationships from schema
relationships.forEach(column => { relationships.forEach(column => {
rows.forEach(row => {
delete row[column]
})
delete schema[column] delete schema[column]
}) })