Skip to content

Commit

Permalink
fix(webapp): remove filter and fix the order of the nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Dec 7, 2022
1 parent bed4c2c commit 872426c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions webapp/src/gql/producer.gql.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const NODES_QUERY = gql`
$offset: Int = 0
$limit: Int = 21
$where: producer_bool_exp
$nodeFilter: node_bool_exp
) {
info: producer_aggregate(where: $where) {
producers: aggregate {
Expand All @@ -57,7 +56,7 @@ export const NODES_QUERY = gql`
total_votes_percent
rank
updated_at
nodes(where: $nodeFilter) {
nodes {
info: endpoints_aggregate(
where: { response: { _contains: { status: 200 } } }
) {
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/hooks/customHooks/useNodeState.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const useNodeState = () => {
...prev.where,
nodes: nodesFilter,
},
nodeFilter: nodesFilter,
}))
}, [filters.name, setPagination])

Expand All @@ -47,7 +46,7 @@ const useNodeState = () => {
if (!producer?.nodes?.length) return []

producer.nodes.sort((a, b) => {
return getOrderNode(a) < getOrderNode(b)
return getOrderNode(b) - getOrderNode(a)
})

return producer.nodes.length
Expand Down
2 changes: 0 additions & 2 deletions webapp/src/hooks/customHooks/useSearchState.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const useSearchState = ({ query, ...options }) => {
where: pagination.where,
offset: (pagination.page - 1) * pagination.limit,
limit: pagination.limit,
nodeFilter: pagination.nodeFilter,
endpointFilter: pagination.endpointFilter,
},
})
Expand All @@ -52,7 +51,6 @@ const useSearchState = ({ query, ...options }) => {
pagination.page,
pagination.limit,
pagination.offset,
pagination.nodeFilter,
pagination.endpointFilter
])

Expand Down

0 comments on commit 872426c

Please sign in to comment.