This repository was archived by the owner on Nov 1, 2024. It is now read-only.
Commit 72574b6 1 parent 11c578e commit 72574b6 Copy full SHA for 72574b6
File tree 1 file changed +7
-3
lines changed
components/dataproducts/accessRequest
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ interface AccessRequestFormProps {
67
67
accessRequest ?: AccessRequestFormInput
68
68
dataset : DatasetQuery
69
69
isEdit : boolean
70
- onSubmit : ( requestData : AccessRequestFormInput ) => void
70
+ onSubmit : ( requestData : AccessRequestFormInput ) => Promise < void >
71
71
error : Error | null
72
72
setModal : ( value : boolean ) => void
73
73
}
@@ -123,7 +123,7 @@ const AccessRequestFormV2 = ({
123
123
loading,
124
124
} = useSearchPolly ( searchText )
125
125
126
- const onSubmitForm = ( data : AccessRequestFields ) => {
126
+ const onSubmitForm = async ( data : AccessRequestFields ) => {
127
127
setSubmitted ( true )
128
128
const accessRequest : AccessRequestFormInput = {
129
129
datasetID : dataset . id ,
@@ -132,7 +132,11 @@ const AccessRequestFormV2 = ({
132
132
polly : polly ?? undefined ,
133
133
expires : data . accessType === 'until' ? data . expires ? new Date ( data . expires ) : undefined : undefined ,
134
134
}
135
- onSubmit ( accessRequest )
135
+ try {
136
+ await onSubmit ( accessRequest )
137
+ } finally {
138
+ setSubmitted ( false )
139
+ }
136
140
}
137
141
138
142
interface Option {
You can’t perform that action at this time.
0 commit comments