refactor api controller to internalize server fetch

This commit is contained in:
jeffvli
2025-11-02 21:56:35 -08:00
parent 8dbaec3943
commit c7a473d864
79 changed files with 904 additions and 399 deletions
@@ -21,7 +21,7 @@ import { Stack } from '/@/shared/components/stack/stack';
import { TextInput } from '/@/shared/components/text-input/text-input';
import { Text } from '/@/shared/components/text/text';
import { toast } from '/@/shared/components/toast/toast';
import { AuthenticationResponse, ServerListItem } from '/@/shared/types/domain-types';
import { AuthenticationResponse, ServerListItemWithCredential } from '/@/shared/types/domain-types';
import { DiscoveredServerItem, ServerType, toServerType } from '/@/shared/types/types';
const autodiscover = isElectron() ? window.api.autodiscover : null;
@@ -152,7 +152,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
});
}
const serverItem: ServerListItem = {
const serverItem: ServerListItemWithCredential = {
credential: data.credential,
id: nanoid(),
name: values.name,
@@ -18,7 +18,12 @@ import { Stack } from '/@/shared/components/stack/stack';
import { TextInput } from '/@/shared/components/text-input/text-input';
import { toast } from '/@/shared/components/toast/toast';
import { Tooltip } from '/@/shared/components/tooltip/tooltip';
import { AuthenticationResponse, ServerListItem, ServerType } from '/@/shared/types/domain-types';
import {
AuthenticationResponse,
ServerListItem,
ServerListItemWithCredential,
ServerType,
} from '/@/shared/types/domain-types';
const localSettings = isElectron() ? window.api.localSettings : null;
@@ -86,7 +91,7 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
});
}
const serverItem: ServerListItem = {
const serverItem: ServerListItemWithCredential = {
credential: data.credential,
id: server.id,
name: values.name,