File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ const path = `${domain()}${appPath}`
13
13
class Forms extends Component {
14
14
state = {
15
15
teamOptions : [ ] ,
16
+ employersOptions : [ ] ,
16
17
...initialState
17
18
}
18
19
19
20
componentDidMount ( ) {
20
21
this . fetchTeamData ( )
22
+ this . fetchEmployers ( )
21
23
}
22
24
23
25
fetchTeamData = async ( ) => {
@@ -34,6 +36,17 @@ class Forms extends Component {
34
36
}
35
37
}
36
38
39
+ fetchEmployers = async ( ) => {
40
+ try {
41
+ const employersResponse = await axios . get ( `${ domain ( ) } /employers` )
42
+ const employersData = employersResponse . data . employers
43
+ employersData . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
44
+ this . setState ( { employersOptions : employersData } )
45
+ } catch ( err ) {
46
+ console . log ( err )
47
+ }
48
+ }
49
+
37
50
handleMagicLinkRequest = async e => {
38
51
e . preventDefault ( )
39
52
const { email, userId } = this . state
@@ -393,6 +406,7 @@ class Forms extends Component {
393
406
telOnChange = { this . telOnChange }
394
407
onChangeCheckList = { this . onChangeCheckList }
395
408
teamOptions = { this . state . teamOptions }
409
+ employersOptions = { this . state . employersOptions }
396
410
{ ...this . props }
397
411
{ ...this . state }
398
412
/>
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export default class VolunteerForm extends Component {
32
32
guidePeople,
33
33
techSkill,
34
34
otherSkill,
35
+ employersOptions,
35
36
employer
36
37
} = this . props
37
38
@@ -146,10 +147,10 @@ export default class VolunteerForm extends Component {
146
147
/>
147
148
{ hearAboutCYFFromEmployer && (
148
149
< EmployerDropDown
149
- arrayList = { ListsData . employerList }
150
+ arrayList = { employersOptions }
150
151
isEmpty = { errors . employer }
151
152
onChange = { onChange }
152
- value = { employer }
153
+ value = { employersOptions }
153
154
/>
154
155
) }
155
156
< span className = "contact-interested" >
You can’t perform that action at this time.
0 commit comments