File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/pages/hackshack/f2fhelper Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { SEO } from '../../../components';
11
11
const Student = ( props ) => {
12
12
const getStudentsApi = `${ process . env . GATSBY_WORKSHOPCHALLENGE_API_ENDPOINT } /api/students` ;
13
13
const getCustomerApi = `${ process . env . GATSBY_WORKSHOPCHALLENGE_API_ENDPOINT } /api/customers` ;
14
- const [ students , setstudents ] = useState ( [ ] ) ;
14
+ const [ students , setStudents ] = useState ( [ ] ) ;
15
15
const [ error , setError ] = useState ( '' ) ;
16
16
const arr = [ ] ;
17
17
const [ index , setIndex ] = useState ( 0 ) ;
@@ -78,7 +78,7 @@ const Student = (props) => {
78
78
arr . push ( { ...response . data } ) ;
79
79
if ( arr . length <= 0 )
80
80
setError ( 'There are currently no active students. Stay tuned!' ) ;
81
- setstudents ( arr ) ;
81
+ setStudents ( [ ... students , ... response . data ] ) ;
82
82
} )
83
83
. catch ( ( err ) => {
84
84
if ( err . response . status === 401 ) {
You can’t perform that action at this time.
0 commit comments