Skip to content

Commit 9e6561a

Browse files
author
Petr Kachanovsky
committed
fix: correct var type in showIn objectification
1 parent 1ab9304 commit 9e6561a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adminforth/modules/configValidator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
AdminForthResourceColumn,
1111
AllowedActions,
1212
ShowIn,
13+
ShowInInput,
1314
} from "../types/Back.js";
1415

1516
import fs from 'fs';
@@ -299,13 +300,12 @@ export default class ConfigValidator implements IConfigValidator {
299300
let showIn = column.showIn || { all: true };
300301

301302
if (column.showIn && Array.isArray(column.showIn)) {
302-
showIn = Object.keys(AdminForthResourcePages).reduce((acc, key) => {
303+
showIn = Object.values(AdminForthResourcePages).reduce((acc, key) => {
303304
return {
304305
...acc,
305306
[key]: column.showIn.includes(key),
306307
}
307-
}, {});
308-
delete showIn.all;
308+
}, {} as ShowInInput);
309309
if (warnings.filter((w) => w.includes('showIn should be an object, array is deprecated')).length === 0) {
310310
warnings.push(`Resource "${resInput.resourceId || resInput.table}" column "${column.name}" showIn should be an object, array is deprecated`);
311311
}

0 commit comments

Comments
 (0)