File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -321,9 +321,14 @@ export default class ConfigValidator implements IConfigValidator {
321321 if ( ! res . columns ) {
322322 res . columns = [ ] ;
323323 }
324- res . columns = res . columns . map ( ( inCol : AdminForthResourceColumnInputCommon ) => {
324+ res . columns = res . columns . map ( ( inCol : AdminForthResourceColumnInputCommon , inColIndex ) => {
325325 const col : Partial < AdminForthResourceColumn > = { ...inCol , required : undefined , editingNote : undefined } ;
326326
327+ // check for duplicate column names
328+ if ( res . columns . findIndex ( ( c ) => c . name === col . name ) !== inColIndex ) {
329+ errors . push ( `Resource "${ res . resourceId } " has duplicate column name "${ col . name } "` ) ;
330+ }
331+
327332 col . label = col . label || guessLabelFromName ( col . name ) ;
328333 //define default sortable
329334 if ( ! Object . keys ( col ) . includes ( 'sortable' ) ) { col . sortable = ! col . virtual ; }
You can’t perform that action at this time.
0 commit comments