aboutsummaryrefslogtreecommitdiffstats
path: root/client/js
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@yahooinc.com>2022-08-14 09:55:50 +0200
committerValerij Fredriksen <valerijf@yahooinc.com>2022-08-14 12:10:08 +0200
commit647d74bf81a2bd85f993df685717b749234b9340 (patch)
treed1c754b3370ee36a0b75ed7126b50092559f431f /client/js
parent560950be64c4e8de5bd2ae870af173febb3524d3 (diff)
Disable form if input has error
Diffstat (limited to 'client/js')
-rw-r--r--client/js/app/src/app/pages/querybuilder/query-endpoint/query-endpoint.jsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/js/app/src/app/pages/querybuilder/query-endpoint/query-endpoint.jsx b/client/js/app/src/app/pages/querybuilder/query-endpoint/query-endpoint.jsx
index 8e8b64bb0d1..09d52640936 100644
--- a/client/js/app/src/app/pages/querybuilder/query-endpoint/query-endpoint.jsx
+++ b/client/js/app/src/app/pages/querybuilder/query-endpoint/query-endpoint.jsx
@@ -30,6 +30,7 @@ function send(event, method, url, body) {
export default function QueryEndpoint() {
const { method, url, fullUrl, body } = useQueryBuilderContext('request');
+ const hasError = useQueryBuilderContext((ctx) => ctx.query.error != null);
const loading = useQueryBuilderContext((ctx) => ctx.http.loading);
return (
@@ -47,7 +48,12 @@ export default function QueryEndpoint() {
value={url}
radius={0}
/>
- <Button radius={0} type="submit" loading={loading}>
+ <Button
+ radius={0}
+ type="submit"
+ loading={loading}
+ disabled={hasError}
+ >
Send
</Button>
</Container>