Skip to content

Commit

Permalink
fix: better ordering of proposals in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
clockworkgr committed Sep 16, 2024
1 parent a60045d commit 5461933
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 224 deletions.
20 changes: 10 additions & 10 deletions src/gql/gql.ts

Large diffs are not rendered by default.

212 changes: 5 additions & 207 deletions src/gql/graphql.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/gql/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./fragment-masking";
export * from "./gql";
export * from "./gql";

Check failure on line 2 in src/gql/index.ts

View workflow job for this annotation

GitHub Actions / Linting

Insert `⏎`

Check failure on line 2 in src/gql/index.ts

View workflow job for this annotation

GitHub Actions / Linting

Insert `⏎`
7 changes: 6 additions & 1 deletion src/graphql/proposalsActive.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
query ProposalsActive($limit: Int!, $offset: Int!, $where: proposal_bool_exp = {}) {
all_proposals: proposal(order_by: { active_first_order: asc }, limit: $limit, offset: $offset, where: $where) {
all_proposals: proposal(
order_by: [{ active_first_order: asc }, { id: desc }]
limit: $limit
offset: $offset
where: $where
) {
content
deposit_end_time
description
Expand Down
7 changes: 6 additions & 1 deletion src/graphql/proposalsFailed.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
query ProposalsFailed($limit: Int!, $offset: Int!, $where: proposal_bool_exp = {}) {
all_proposals: proposal(order_by: { failed_first_order: asc }, limit: $limit, offset: $offset, where: $where) {
all_proposals: proposal(
order_by: [{ failed_first_order: asc }, { id: desc }]
limit: $limit
offset: $offset
where: $where
) {
content
deposit_end_time
description
Expand Down
7 changes: 6 additions & 1 deletion src/graphql/proposalsPassed.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
query ProposalsPassed($limit: Int!, $offset: Int!, $where: proposal_bool_exp = {}) {
all_proposals: proposal(order_by: { passed_first_order: asc }, limit: $limit, offset: $offset, where: $where) {
all_proposals: proposal(
order_by: [{ passed_first_order: asc }, { id: desc }]
limit: $limit
offset: $offset
where: $where
) {
content
deposit_end_time
description
Expand Down
7 changes: 6 additions & 1 deletion src/graphql/proposalsRejected.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
query ProposalsRejected($limit: Int!, $offset: Int!, $where: proposal_bool_exp = {}) {
all_proposals: proposal(order_by: { rejected_first_order: asc }, limit: $limit, offset: $offset, where: $where) {
all_proposals: proposal(
order_by: [{ rejected_first_order: asc }, { id: desc }]
limit: $limit
offset: $offset
where: $where
) {
content
deposit_end_time
description
Expand Down
11 changes: 9 additions & 2 deletions src/graphql/proposalsSearch.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
query ProposalsSearch($limit: Int!, $offset: Int!, $searchString: String!) {
all_proposals: proposal(order_by: { active_first_order: asc }, limit: $limit, offset: $offset, where: {_or: [{title: {_ilike: $searchString}},{description: {_ilike: $searchString}}]}) {
all_proposals: proposal(
order_by: [{ active_first_order: asc }, { id: desc }]
limit: $limit
offset: $offset
where: { _or: [{ title: { _ilike: $searchString } }, { description: { _ilike: $searchString } }] }
) {
content
deposit_end_time
description
Expand All @@ -21,7 +26,9 @@ query ProposalsSearch($limit: Int!, $offset: Int!, $searchString: String!) {
voting_end_time
voting_start_time
}
proposal_aggregate(where: {_or: [{title: {_ilike: $searchString}},{description: {_ilike: $searchString}}]}) {
proposal_aggregate(
where: { _or: [{ title: { _ilike: $searchString } }, { description: { _ilike: $searchString } }] }
) {
aggregate {
count
}
Expand Down

0 comments on commit 5461933

Please sign in to comment.