[FWA-5] Home Create and List
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { ROUTES } from '@routes/routes'
|
||||
import { AES, enc } from 'crypto-js'
|
||||
import { LOGIN_KEY, SECRET_KEY, STORE_KEY } from './enum'
|
||||
|
||||
@ -58,16 +59,18 @@ export class Helpers {
|
||||
}
|
||||
|
||||
static clearArrayWithNullObject = (array) => {
|
||||
console.log(array)
|
||||
array.forEach((element, i) => {
|
||||
const obk = this.clearObject(element)
|
||||
if (obk) array.splice(i, 1)
|
||||
})
|
||||
// for (let i = 0; i < array.length; i++) {
|
||||
// if (array[i] === null || array[i] === undefined) {
|
||||
// array.splice(i, 1)
|
||||
// }
|
||||
// }
|
||||
if (array instanceof Array) {
|
||||
array.forEach((element, i) => {
|
||||
if (element instanceof Object) {
|
||||
const obk = this.clearObject(element)
|
||||
if (obk) array.splice(i, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return array.length > 0 ? array : null
|
||||
}
|
||||
|
||||
static getRoutePath = (pathName) =>
|
||||
ROUTES.filter((r) => r.name === pathName)[0].path
|
||||
}
|
||||
|
Reference in New Issue
Block a user