[FWA-5] Home Create and List

This commit is contained in:
2024-07-03 08:57:50 +00:00
parent 1c205c69ac
commit b938f296c1
33 changed files with 414 additions and 93 deletions

View File

@ -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
}