diff --git a/src/ClientApp/.vscode/settings.json b/src/ClientApp/.vscode/settings.json index e35422a..2ab4571 100644 --- a/src/ClientApp/.vscode/settings.json +++ b/src/ClientApp/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.tabSize": 2, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/src/ClientApp/ApiRoutes.tsx b/src/ClientApp/ApiRoutes.tsx index 2d8ec84..41e549e 100644 --- a/src/ClientApp/ApiRoutes.tsx +++ b/src/ClientApp/ApiRoutes.tsx @@ -1,9 +1,9 @@ enum ApiRoutes { - CACHE_ACCOUNTS = 'api/cache/accounts', - CACHE_ACCOUNT = 'api/cache/account/{accountId}', - CACHE_ACCOUNT_CONTACTS = 'api/cache/account/{accountId}/contacts', - CACHE_ACCOUNT_CONTACT = 'api/cache/account/{accountId}/contact/{index}', - CACHE_ACCOUNT_HOSTNAMES = 'api/cache/account/{accountId}/hostnames' + ACCOUNTS = 'api/accounts', + ACCOUNT = 'api/account/{accountId}', + ACCOUNT_CONTACTS = 'api/account/{accountId}/contacts', + ACCOUNT_CONTACT = 'api/account/{accountId}/contact/{index}', + ACCOUNT_HOSTNAMES = 'api/account/{accountId}/hostnames' // CERTS_FLOW_CONFIGURE_CLIENT = `api/CertsFlow/ConfigureClient`, // CERTS_FLOW_TERMS_OF_SERVICE = `api/CertsFlow/TermsOfService/{sessionId}`, diff --git a/src/ClientApp/app/page.tsx b/src/ClientApp/app/page.tsx index 218fb1e..9a8b8e8 100644 --- a/src/ClientApp/app/page.tsx +++ b/src/ClientApp/app/page.tsx @@ -10,7 +10,7 @@ import { } from '@/hooks/useValidation' import { CustomButton, CustomInput } from '@/controls' import { TrashIcon, PlusIcon } from '@heroicons/react/24/solid' -import { GetAccountResponse } from '@/models/letsEncryptServer/cache/responses/GetAccountResponse' +import { GetAccountResponse } from '@/models/letsEncryptServer/account/responses/GetAccountResponse' import { deepCopy } from './functions' import { CacheAccount } from '@/entities/CacheAccount' @@ -50,18 +50,21 @@ export default function Page() { const fetchAccounts = async () => { const newAccounts: CacheAccount[] = [] const accounts = await httpService.get( - GetApiRoute(ApiRoutes.CACHE_ACCOUNTS) + GetApiRoute(ApiRoutes.ACCOUNTS) ) accounts?.forEach((account) => { newAccounts.push({ accountId: account.accountId, + description: account.description, contacts: account.contacts, - hostnames: account.hostnames.map((h) => ({ - hostname: h.hostname, - expires: new Date(h.expires), - isUpcomingExpire: h.isUpcomingExpire - })), + challengeType: account.challengeType, + hostnames: + account.hostnames?.map((h) => ({ + hostname: h.hostname, + expires: new Date(h.expires), + isUpcomingExpire: h.isUpcomingExpire + })) ?? [], isEditMode: false }) }) @@ -97,7 +100,7 @@ export default function Page() { // TODO: Remove from cache httpService.delete( - GetApiRoute(ApiRoutes.CACHE_ACCOUNT_CONTACT, accountId, contact) + GetApiRoute(ApiRoutes.ACCOUNT_CONTACT, accountId, contact) ) setAccounts( @@ -387,7 +390,9 @@ export default function Page() { ) : ( <>
-

Description:

+

+ Description: {account.description} +

Contacts:

@@ -399,6 +404,11 @@ export default function Page() { ))}
+
+

+ Challenge type: {account.challengeType} +

+

Hostnames: