From edc5c20fdb7bc908303f57294e150667c49b590a Mon Sep 17 00:00:00 2001 From: baldo Date: Thu, 21 Jul 2022 18:44:52 +0200 Subject: [PATCH] Fix some types after refactoring on main branch. --- frontend/src/components/nodes/NodesFilterPanel.vue | 5 +++-- frontend/src/stores/nodes.ts | 10 +++++----- frontend/src/views/AdminNodesView.vue | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/nodes/NodesFilterPanel.vue b/frontend/src/components/nodes/NodesFilterPanel.vue index f308b0b..f22d986 100644 --- a/frontend/src/components/nodes/NodesFilterPanel.vue +++ b/frontend/src/components/nodes/NodesFilterPanel.vue @@ -202,7 +202,7 @@ function buildNodesFilter(): NodesFilter { return nodesFilter; } -let lastSearchTimestamp: UnixTimestampMilliseconds = 0; +let lastSearchTimestamp: UnixTimestampMilliseconds = 0 as UnixTimestampMilliseconds; let searchTimeout: NodeJS.Timeout | undefined = undefined; let lastSearchTerm = ""; @@ -221,7 +221,8 @@ function doThrottledSearch(): void { return } - const now: UnixTimestampMilliseconds = Date.now(); + // TODO: Share utils. + const now: UnixTimestampMilliseconds = Date.now() as UnixTimestampMilliseconds; if (now - SEARCH_THROTTLE_DELAY_MS >= lastSearchTimestamp) { lastSearchTimestamp = now; doSearch(); diff --git a/frontend/src/stores/nodes.ts b/frontend/src/stores/nodes.ts index 67349c3..889f54c 100644 --- a/frontend/src/stores/nodes.ts +++ b/frontend/src/stores/nodes.ts @@ -1,9 +1,9 @@ import {defineStore} from "pinia"; -import {type EnhancedNode, isEnhancedNode, type NodesFilter, NodeSortField, SortDirection} from "@/types"; +import {type DomainSpecificNodeResponse, isDomainSpecificNodeResponse, type NodesFilter, NodeSortField, SortDirection} from "@/types"; import {internalApi} from "@/utils/Api"; interface NodesStoreState { - nodes: EnhancedNode[]; + nodes: DomainSpecificNodeResponse[]; page: number; nodesPerPage: number; totalNodes: number; @@ -24,7 +24,7 @@ export const useNodesStore = defineStore({ }; }, getters: { - getNodes(state: NodesStoreState): EnhancedNode[] { + getNodes(state: NodesStoreState): DomainSpecificNodeResponse[] { return state.nodes; }, @@ -55,9 +55,9 @@ export const useNodesStore = defineStore({ if (searchTerm) { query.q = searchTerm; } - const result = await internalApi.getPagedList( + const result = await internalApi.getPagedList( "nodes", - isEnhancedNode, + isDomainSpecificNodeResponse, page, nodesPerPage, sortDirection, diff --git a/frontend/src/views/AdminNodesView.vue b/frontend/src/views/AdminNodesView.vue index a1f727b..53ffe64 100644 --- a/frontend/src/views/AdminNodesView.vue +++ b/frontend/src/views/AdminNodesView.vue @@ -1,7 +1,7 @@