Merge pull request #215 from shreyash1231/fix/Disabled-Create-Customer-Button-Until-Id-Or-Email-is-Filled-To-Prevent-API-CALL
Fix/disabled create customer button until id or email is filled to prevent api call
This commit is contained in:
@@ -75,14 +75,18 @@ function CreateCustomer() {
|
||||
</DialogHeader>
|
||||
<div className="flex gap-2">
|
||||
<div>
|
||||
<FieldLabel>Name</FieldLabel>
|
||||
<FieldLabel>
|
||||
Name
|
||||
</FieldLabel>
|
||||
<Input
|
||||
value={fields.name}
|
||||
onChange={(e) => setFields({ ...fields, name: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<FieldLabel>ID</FieldLabel>
|
||||
<FieldLabel>
|
||||
ID
|
||||
</FieldLabel>
|
||||
<Input
|
||||
value={fields.id}
|
||||
onChange={(e) => setFields({ ...fields, id: e.target.value })}
|
||||
@@ -111,6 +115,7 @@ function CreateCustomer() {
|
||||
onClick={handleCreate}
|
||||
isLoading={isLoading}
|
||||
variant="gradientPrimary"
|
||||
disabled={!fields.id.trim() && !fields.email.trim()} // ✅ at least one of id or email
|
||||
>
|
||||
Create
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user