Skip to content

Commit e90ab0d

Browse files
committed
fix: create record copy before checking for showIf
1 parent 06f90d0 commit e90ab0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adminforth/spa/src/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,10 @@ export function createSearchInputHandlers(
448448

449449
export function checkShowIf(c: AdminForthResourceColumnInputCommon, record: Record<string, any>, allColumns: AdminForthResourceColumnInputCommon[]) {
450450
if (!c.showIf) return true;
451+
const recordCopy = { ...record };
451452
for (const col of allColumns) {
452-
if (!record[col.name]) {
453-
record[col.name] = null;
453+
if (!recordCopy[col.name]) {
454+
recordCopy[col.name] = null;
454455
}
455456
}
456457
const evaluatePredicate = (predicate: Predicate): boolean => {

0 commit comments

Comments
 (0)