minhnt-dev: only ssr

This commit is contained in:
MoreStrive
2024-06-21 09:56:34 +07:00
parent 229155b24a
commit 6a275c354e
18 changed files with 84 additions and 1003 deletions
+9
View File
@@ -0,0 +1,9 @@
const isEmpty = (value : any) => {
return (
value == null || // From standard.js: Always use === - but obj == null is allowed to check null || undefined
(typeof value === 'object' && Object.keys(value).length === 0) ||
(typeof value === 'string' && value.trim().length === 0)
)
}
export { isEmpty }
+1 -1
View File
@@ -1,4 +1,4 @@
import isEmpty from "lodash/isEmpty";
import { isEmpty } from "@/utils/lodash";
const keyMapping = {
// 3 query key để phân loại
+1 -3
View File
@@ -1,7 +1,5 @@
import cloneDeep from 'lodash/cloneDeep';
export function buildTree(data: any) {
const _array = cloneDeep(JSON.parse(data))
const _array = JSON.parse(JSON.stringify(JSON.parse(data)))
if (_array.length > 0) {
let map = new Map();
_array.forEach((item : any) => map.set(item.id, item));