Fixed submitting on storeApiKeyModal

This commit is contained in:
Lucas Oliveira 2024-05-24 14:34:04 +02:00
commit bc5cd9e7e2

View file

@ -58,7 +58,7 @@ export default function StoreApiKeyModal({
setHasApiKey(false); setHasApiKey(false);
setValidApiKey(false); setValidApiKey(false);
setLoadingApiKey(false); setLoadingApiKey(false);
} },
); );
} }
}; };
@ -71,8 +71,8 @@ export default function StoreApiKeyModal({
(hasApiKey && !validApiKey (hasApiKey && !validApiKey
? INVALID_API_KEY ? INVALID_API_KEY
: !hasApiKey : !hasApiKey
? NO_API_KEY ? NO_API_KEY
: "") + INSERT_API_KEY : "") + INSERT_API_KEY
} }
> >
<span className="pr-2">API Key</span> <span className="pr-2">API Key</span>
@ -121,6 +121,7 @@ export default function StoreApiKeyModal({
<Button <Button
className="mr-3" className="mr-3"
variant="outline" variant="outline"
type="button"
onClick={() => { onClick={() => {
setOpen(false); setOpen(false);
}} }}
@ -128,14 +129,13 @@ export default function StoreApiKeyModal({
Cancel Cancel
</Button> </Button>
<Form.Submit asChild> <Button
<Button data-testid="api-key-save-button-store"
data-testid="api-key-save-button-store" className="mt-8"
className="mt-8" type="submit"
> >
Save Save
</Button> </Button>
</Form.Submit>
</div> </div>
</div> </div>
</Form.Root> </Form.Root>