Skip to content

Commit

Permalink
Merge pull request #12 from availproject/vr/fix/tx-response
Browse files Browse the repository at this point in the history
fix(services): add sourceChain to tx reponse.
  • Loading branch information
moraesjeremias authored Jul 20, 2024
2 parents e19006c + 2ecd5d1 commit 81e2fb5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/services/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class TransactionService {
totalCount = await prisma.availsends.count({
where,
});
transactions = await prisma.availsends.findMany({
const response = await prisma.availsends.findMany({
where,
select: {
messageId: true,
Expand Down Expand Up @@ -76,11 +76,19 @@ export default class TransactionService {
sourceBlockNumber: "desc",
},
});

transactions = response.map((tx: Object) => {
return {
...tx,
//TODO: Remove below, should be handled by front end.
sourceChain: "AVAIL"
}
})
} else {
totalCount = await prisma.ethereumsends.count({
where,
});
transactions = await prisma.ethereumsends.findMany({
const response = await prisma.ethereumsends.findMany({
where,
select: {
messageId: true,
Expand Down Expand Up @@ -109,6 +117,13 @@ export default class TransactionService {
sourceBlockNumber: "desc",
},
});

transactions = response.map((tx: Object) => {
return {
...tx,
sourceChain: "ETHEREUM"
}
});
}

const result: any = [];
Expand Down

0 comments on commit 81e2fb5

Please sign in to comment.