modified: frontend/src/components/EndpointModal.tsx
This commit is contained in:
@@ -184,7 +184,7 @@ export default function EndpointModal({
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">База данных</label>
|
||||
<select
|
||||
required
|
||||
required={formData.execution_type === 'sql'}
|
||||
value={formData.database_id}
|
||||
onChange={(e) => setFormData({ ...formData, database_id: e.target.value })}
|
||||
className="input w-full"
|
||||
@@ -511,9 +511,11 @@ export default function EndpointModal({
|
||||
type="button"
|
||||
onClick={() => testMutation.mutate()}
|
||||
disabled={
|
||||
!formData.database_id ||
|
||||
(formData.execution_type === 'sql' ? !formData.sql_query : !formData.script_code) ||
|
||||
testMutation.isPending
|
||||
testMutation.isPending ||
|
||||
(formData.execution_type === 'sql'
|
||||
? (!formData.database_id || !formData.sql_query)
|
||||
: !formData.script_code
|
||||
)
|
||||
}
|
||||
className="btn btn-secondary flex items-center gap-2"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user