File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/pages/academy/adminPanel/subcomponents Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ const AddUserPanel: React.FC<AddUserPanelProps> = props => {
94
94
hasInvalidInput = true ;
95
95
}
96
96
97
- for ( const e of data ) {
97
+ for ( let i = 0 ; i < data . length ; i ++ ) {
98
98
// Incorrect number of columns
99
- if ( ! ( e . data . length === 2 || e . data . length === 3 ) ) {
99
+ if ( ! ( data [ i ] . data . length === 2 || data [ i ] . data . length === 3 ) ) {
100
100
setInvalidCsvMsg (
101
101
< >
102
102
< div >
103
- Invalid format! Please ensure that the username and role is specified for each row
104
- entry!
103
+ Invalid format (line { i } ) ! Please ensure that the username and role is specified for
104
+ each row entry!
105
105
</ div >
106
106
< br />
107
107
< div >
@@ -115,9 +115,9 @@ const AddUserPanel: React.FC<AddUserPanelProps> = props => {
115
115
break ;
116
116
}
117
117
// Invalid role specified
118
- if ( ! Object . values ( Role ) . includes ( e . data [ 1 ] ) ) {
118
+ if ( ! Object . values ( Role ) . includes ( data [ i ] . data [ 1 ] ) ) {
119
119
setInvalidCsvMsg (
120
- ' Invalid role! Please ensure that the second column of each entry contains one of the following: admin, staff, student'
120
+ ` Invalid role (line ${ i } ) ! Please ensure that the second column of each entry contains one of the following: admin, staff, student'`
121
121
) ;
122
122
hasInvalidInput = true ;
123
123
break ;
You can’t perform that action at this time.
0 commit comments