Skip to content

Commit

Permalink
Merge pull request #323 from infinitybase/feat/predicates/fields
Browse files Browse the repository at this point in the history
feat: add field to return on external predicate route
  • Loading branch information
guimroque authored Oct 29, 2024
2 parents ce528c8 + 29f7ac3 commit ad98224
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/api/src/modules/predicate/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ export class PredicateController {
const response = await this.predicateService
.paginate({ page, perPage })
.filter({
select: ['p.id', 'p.predicateAddress', 'p.createdAt'],
select: [
'p.id',
'p.predicateAddress',
'p.createdAt',
'p.root',
'owner.id',
],
})
.listDateMoreThan(d ? new Date(d) : undefined);

Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/modules/predicate/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ export class PredicateService implements IPredicateService {
}

async listDateMoreThan(d?: Date) {
const queryBuilder = Predicate.createQueryBuilder('p');
const queryBuilder = Predicate.createQueryBuilder('p').innerJoin(
'p.owner',
'owner',
);

if (d) {
queryBuilder.where({
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/modules/transaction/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const formatFuelTransaction = async (

const formattedTransaction = {
id: tx.id,
name: `DEPOSIT_${tx.id}`, // TODO: change this
name: 'Deposit',
hash: tx.id.slice(2),
sendTime: tx.date,
createdAt: tx.date,
Expand Down

0 comments on commit ad98224

Please sign in to comment.