(feat) improve accounts name

This commit is contained in:
cardosofede
2024-06-26 00:29:24 +02:00
parent d07bf9233e
commit ffd3cd9342
2 changed files with 3 additions and 2 deletions

View File

@@ -253,7 +253,7 @@ class BackendAPIClient:
def delete_account(self, account_name: str):
"""Delete an account."""
endpoint = "delete-account/"
endpoint = "delete-account"
return self.post(endpoint, params={"account_name": account_name})
def delete_credential(self, account_name: str, connector_name: str):

View File

@@ -42,6 +42,7 @@ with c1:
st.header("Create a New Account")
new_account_name = st.text_input("New Account Name")
if st.button("Create Account"):
new_account_name = new_account_name.strip()
if new_account_name:
if new_account_name in accounts:
st.warning(f"Account {new_account_name} already exists.")
@@ -49,7 +50,7 @@ with c1:
elif new_account_name == "":
st.warning("Please enter a valid account name.")
st.stop()
response = client.add_account(new_account_name.strip())
response = client.add_account(new_account_name)
st.write(response)
else:
st.write("Please enter an account name.")