Skip to content

Commit c62ab0a

Browse files
committed
refactor(web): use shared callback server type
1 parent dbdcdc5 commit c62ab0a

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

‎web/src/store/server.ts‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ import { useThemeStore } from '~/store/theme';
5151
import { useUnraidApiStore } from '~/store/unraidApi';
5252
import { getRegistrationDeviceLimit, normalizeRegistrationType } from '~/utils/registration';
5353

54-
type ServerCallbackPayload = ServerData & Pick<Server, 'flashGuid' | 'tpmGuid'>;
55-
5654
export const useServerStore = defineStore('server', () => {
5755
const { t } = useI18n();
5856
const accountStore = useAccountStore();
@@ -248,10 +246,8 @@ export const useServerStore = defineStore('server', () => {
248246
}
249247
};
250248

251-
const buildServerCallbackPayload = (
252-
overrides: Partial<ServerCallbackPayload> = {}
253-
): ServerCallbackPayload => {
254-
const payload: ServerCallbackPayload = {
249+
const buildServerCallbackPayload = (overrides: Partial<ServerData> = {}): ServerData => {
250+
const payload: ServerData = {
255251
connectPluginVersion: connectPluginVersion.value || undefined,
256252
connectState: getConnectState(),
257253
description: description.value,
@@ -300,12 +296,12 @@ export const useServerStore = defineStore('server', () => {
300296
};
301297
};
302298

303-
const serverPurchasePayload = computed((): ServerCallbackPayload => buildServerCallbackPayload());
299+
const serverPurchasePayload = computed((): ServerData => buildServerCallbackPayload());
304300

305-
const serverAccountPayload = computed((): ServerCallbackPayload => buildServerCallbackPayload());
301+
const serverAccountPayload = computed((): ServerData => buildServerCallbackPayload());
306302

307303
const serverReplacePayload = computed(
308-
(): ServerCallbackPayload => ({
304+
(): ServerData => ({
309305
...buildServerCallbackPayload({
310306
guid: replaceFlashGuid.value,
311307
}),

0 commit comments

Comments
 (0)