This repository was archived by the owner on Apr 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ export default function CreateForm(props: IProps) {
40
40
// userInputs = [{ preselectedInput }, ...userInputs];
41
41
// }
42
42
const promise = customApiClient . cimStartForm ( formKey , userInputs ) . then (
43
- ( form ) => {
44
- handleSubmit ( form ) ;
43
+ async ( form ) => {
44
+ await handleSubmit ( form ) ;
45
45
setFlash ( intl . formatMessage ( { id : `cim.flash.${ formKey } ` } ) ) ;
46
46
} ,
47
47
( e ) => {
Original file line number Diff line number Diff line change @@ -24,14 +24,16 @@ import ApplicationContext from "utils/ApplicationContext";
24
24
export default function CreateServiceTicket ( ) {
25
25
const { redirect, customApiClient } = useContext ( ApplicationContext ) ;
26
26
27
- const handleSubmit = ( userInputs : any ) => {
27
+ const handleSubmit = async ( userInputs : any ) => {
28
28
const ticket : CreateServiceTicketPayload = {
29
29
ims_pw_id : userInputs . ims_ticket . name ,
30
30
jira_ticket_id : userInputs . jira_ticket . ticket_id ,
31
31
title_nl : userInputs . jira_ticket . summary ,
32
32
type : userInputs . ticket_type ,
33
33
} ;
34
- customApiClient . cimCreateTicket ( ticket ) . then ( ( _ ) => redirect ( "/tickets" ) ) ;
34
+ return customApiClient . cimCreateTicket ( ticket ) . then ( ( _ ) => {
35
+ redirect ( "/tickets" ) ;
36
+ } ) ;
35
37
} ;
36
38
37
39
return (
You can’t perform that action at this time.
0 commit comments