Skip to content

Commit

Permalink
fix: Fetch only templates of the default_address (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Jun 30, 2023
1 parent 7a2afae commit ae58e99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Project/SearchableProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import {
} from '.'
import { AuthRequest } from '../middleware'
import { RequestParameters } from '../RequestParameters'
import { getDefaultEthAddress } from '../AssetPack/utils'
import {
SearchableModel,
SearchableParameters,
SearchableConditions,
} from '../Searchable'

const DEFAULT_ETH_ADDRESS = getDefaultEthAddress()

export class SearchableProject {
constructor(private req: AuthRequest | Request) {}

Expand Down Expand Up @@ -49,6 +52,8 @@ export class SearchableProject {
{ eq: searchableProjectProperties }
)
conditions.addExtras('eq', { is_template: true })
// For now, fetch templates only from the DEFAULT_ETH_ADDRESS
conditions.addExtras('eq', { eth_address: DEFAULT_ETH_ADDRESS })
conditions.addExtras('eq', { is_deleted: false })

return searchableProject.search(parameters, conditions)
Expand Down

0 comments on commit ae58e99

Please sign in to comment.