Skip to content

Commit

Permalink
fix: consistent naming in top collection query (#1169)
Browse files Browse the repository at this point in the history
* consistent naming in top collection query

* fix

* without changing
  • Loading branch information
justraman authored Jul 10, 2024
1 parent 0b0f31a commit 0ff3c99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server-extension/resolvers/top_collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Field, ObjectType, Query, Resolver, Arg, registerEnumType, ID, Int } fr
import { Json } from '@subsquid/graphql-server'
import 'reflect-metadata'
import type { EntityManager } from 'typeorm'
import { Collection, CollectionAccount, Listing, ListingSale, ListingStatus, Token } from '../../model'
import { Collection, Listing, ListingSale, ListingStatus, Token } from '../../model'

enum Timeframe {
HOUR = 'HOUR',
Expand Down Expand Up @@ -125,6 +125,7 @@ export class TopCollectionResolver {
.addSelect('stats AS stats')
.addSelect('volume_last_duration AS volume')
.addSelect('sales_last_duration AS sales')
.addSelect('verified_at::text AS "verifiedAt"')
.addSelect('category AS category')
.addSelect(
'CASE WHEN volume_previous_duration != 0 THEN ROUND((volume_last_duration - volume_previous_duration) * 100 / volume_previous_duration, 2) ELSE null END AS volume_change'
Expand All @@ -141,7 +142,7 @@ export class TopCollectionResolver {
.select('collection.id AS collectionId')
.addSelect('collection.metadata AS metadata')
.addSelect('collection.stats AS stats')
.addSelect('collection.verified_at AS verifiedAt')
.addSelect('collection.verified_at AS verified_at')
.addSelect('collection.category AS category')
if (timeFrame === Timeframe.ALL) {
inBuilder
Expand Down Expand Up @@ -184,7 +185,6 @@ export class TopCollectionResolver {
.innerJoin(Listing, 'listing', 'listing.id = sale.listing')
.innerJoin(Token, 'token', 'listing.make_asset_id_id = token.id')
.innerJoin(Collection, 'collection', 'token.collection = collection.id')

.leftJoin(ListingStatus, 'status', `listing.id = status.listing AND status.type = 'Finalized'`)
.addGroupBy('collection.id')

Expand Down

0 comments on commit 0ff3c99

Please sign in to comment.