File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
designer/client/pages/landing-page Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type Props = {
13
13
type State = {
14
14
configs : { Key : string ; DisplayName : string } [ ] ;
15
15
loading ?: boolean ;
16
+
16
17
} ;
17
18
18
19
export class ViewFundForms extends Component < Props , State > {
@@ -25,30 +26,23 @@ export class ViewFundForms extends Component<Props, State> {
25
26
} ;
26
27
}
27
28
28
- componentDidMount ( ) {
29
- formConfigurationApi . loadConfigurations ( ) . then ( ( configs ) => {
29
+ async componentDidMount ( ) {
30
+ try {
31
+ const configs = await formConfigurationApi . loadConfigurations ( ) ;
30
32
this . setState ( {
31
33
loading : false ,
32
34
configs,
33
35
} ) ;
34
- } ) ;
36
+ } catch ( error ) {
37
+ logger . error ( "ViewFundForms componentDidMount" , error ) ;
38
+ this . setState ( { loading : false } ) ;
39
+ }
35
40
}
36
41
37
42
selectForm = async ( form ) => {
38
43
try {
39
- const response = await window . fetch ( "/api/new" , {
40
- method : "POST" ,
41
- body : JSON . stringify ( {
42
- selected : { Key : form } ,
43
- name : "" ,
44
- } ) ,
45
- headers : {
46
- Accept : "application/json" ,
47
- "Content-Type" : "application/json" ,
48
- } ,
49
- } ) ;
50
- const responseJson = await response . json ( ) ;
51
- this . props . history . push ( `/designer/${ responseJson . id } ` ) ;
44
+ // Always go directly to edit the form from Pre-Award API
45
+ this . props . history . push ( `/designer/${ form } ` ) ;
52
46
} catch ( e ) {
53
47
logger . error ( "ChooseExisting" , e ) ;
54
48
}
You can’t perform that action at this time.
0 commit comments