diff --git a/backend/app/app/api/api_v1/endpoints/node.py b/backend/app/app/api/api_v1/endpoints/node.py index c130de9..3bdd038 100755 --- a/backend/app/app/api/api_v1/endpoints/node.py +++ b/backend/app/app/api/api_v1/endpoints/node.py @@ -188,14 +188,14 @@ async def read_graph(action_type, send_json, project_uuid): 'elements': blueprint.pop('elements'), } nodes.append(blueprint) - if len(edges[0]) >= 1: - [edges_data.append({ - 'id': f"{i}", - 'source': f"{e[2]['from'].id}", - 'target': f"{e[3]['to'].id}", - 'label': e[1][T.label], - 'type': 'float' - }) for i, e in enumerate(chunks(edges[0], 4))] + if len(edges[0]) >= 1: + [edges_data.append({ + 'id': f"{i}", + 'source': f"{e[2]['from'].id}", + 'target': f"{e[3]['to'].id}", + 'label': e[1][T.label], + 'type': 'float' + }) for i, e in enumerate(chunks(edges[0], 4))] await send_json({ 'action': 'addInitialLoad', 'nodes': nodes, diff --git a/frontend/src/routes/dashboard/_components/tabs/EntitiesPanel.tsx b/frontend/src/routes/dashboard/_components/tabs/EntitiesPanel.tsx index ca8be74..06c9682 100644 --- a/frontend/src/routes/dashboard/_components/tabs/EntitiesPanel.tsx +++ b/frontend/src/routes/dashboard/_components/tabs/EntitiesPanel.tsx @@ -9,7 +9,7 @@ export default function EntitiesPanel({ isLoading, isError, isSuccess, - refreshAllEntities, + refetchEntities, }: JSONObject) { const [showFavoriteEntities, setShowFavoriteEntities] = useState(true); const [showEntities, setShowEntities] = useState(true); @@ -32,7 +32,7 @@ export default function EntitiesPanel({ const updateEntityOnBookmark = async (hid: string) => { await updateEntityIsFavorite({ hid }) - refreshAllEntities() + refetchEntities() } return ( diff --git a/frontend/src/routes/dashboard/index.tsx b/frontend/src/routes/dashboard/index.tsx index 7b3c99d..67d7999 100755 --- a/frontend/src/routes/dashboard/index.tsx +++ b/frontend/src/routes/dashboard/index.tsx @@ -64,7 +64,7 @@ export default function DashboardPage() { isLoading, isError, isSuccess, - refetch: refreshAllEntities, + refetch: refetchEntities, } = useGetEntitiesQuery({ skip: 0, limit: 50 }) const scrollGraphs = ({ skip, limit, favoriteSkip, favoriteLimit }: ScrollGraphs) => { @@ -153,7 +153,8 @@ export default function DashboardPage() { isLoading={isLoading} isError={isError} isSuccess={isSuccess} - updateEntities={refreshAllEntities} + refetchEntities={refetchEntities} + /> @@ -196,7 +197,7 @@ export default function DashboardPage() { refreshAllGraphs={async () => await refetchGraphs()} /> await refreshAllEntities()} + refreshAllEntities={async () => await refetchEntities()} cancelCreateRef={cancelCreateEntityRef} isOpen={showCreateEntityModal} closeModal={() => setShowCreateEntityModal(false)}