refactor: api keys API (#2652)

* feat: create useDeleteApiKey hook to handle api keys delete

* refactor: use mutation to handle delete api key

* [autofix.ci] apply automated fixes

* feat: create useGetApiKeys hook

* refactor: use useGetApiKeysQuery hook to get api keys data

* [autofix.ci] apply automated fixes

* refactor: change interface name

* refactor: remove unnused loading state and use react state instead of react ref to ensure component render

* fix: multiple refreshs when auto_login=false

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Igor Carvalho 2024-07-29 16:04:58 -03:00 • committed by GitHub
commit 6fa3c7b17d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 140 additions and 107 deletions

View file

@ -110,9 +110,8 @@ test("PromptTemplateComponent", async ({ page }) => {
}
value =
(await page
.locator('//*[@id="textarea_str_edit_prompt1"]')
.inputValue()) ?? "";
(await page.locator('//*[@id="textarea_str_edit_prompt1"]').inputValue()) ??
"";
if (value != "prompt_name_test_123123!@#!@#") {
expect(false).toBeTruthy();
@ -126,14 +125,14 @@ test("PromptTemplateComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
await page.getByTestId('textarea_str_edit_prompt1-ExternalLink').click();
await page.getByTestId("textarea_str_edit_prompt1-ExternalLink").click();
await page
.getByTestId("text-area-modal")
.fill("prompt_edit_test_12312312321!@#$");
await page.getByText("Finish Editing", { exact: true }).click();
await page.getByTestId('textarea_str_edit_prompt-ExternalLink').click();
await page.getByTestId("textarea_str_edit_prompt-ExternalLink").click();
await page
.getByTestId("text-area-modal")
.fill("prompt_edit_test_44444444444!@#$");
@ -194,9 +193,8 @@ test("PromptTemplateComponent", async ({ page }) => {
}
value =
(await page
.locator('//*[@id="textarea_str_edit_prompt1"]')
.inputValue()) ?? "";
(await page.locator('//*[@id="textarea_str_edit_prompt1"]').inputValue()) ??
"";
if (value != "prompt_edit_test_12312312321!@#$") {
expect(false).toBeTruthy();