Skip to content

Commit

Permalink
removed old flattendata.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Mar 10, 2022
1 parent 300c6ed commit 4e92e2e
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/views/tenant/administration/GraphExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,11 @@ const GraphExplorer = () => {
}
const [execGraphRequest, graphrequest] = useLazyGenericGetRequestQuery()
const QueryColumns = { set: false, data: [] }
const flattenObject = (obj) => {
const flattened = {}

Object.keys(obj).forEach((key) => {
const value = obj[key]

if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
Object.assign(flattened, flattenObject(value))
} else {
flattened[key] = value
}
})

return flattened
}

if (graphrequest.isSuccess) {
if (graphrequest.data.length === 0) {
graphrequest.data = [{ data: 'No Data Found' }]
}
//set data
const finalData = graphrequest.data.forEach((obj) => {
flattenObject(obj)
})

//set columns

Expand Down

0 comments on commit 4e92e2e

Please sign in to comment.