Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions packages/api/src/modules/transaction/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,9 @@ export class TransactionService implements ITransactionService {
});

// =============== specific for workspace ===============
if (this._filter.workspaceId || this._filter.signer) {
if (this._filter.signer) {
queryBuilder.andWhere(
new Brackets(qb => {
if (this._filter.workspaceId) {
qb.orWhere('workspace.id IN (:...workspace)', {
workspace: this._filter.workspaceId,
});
}
if (this._filter.signer) {
qb.orWhere('members.address = :signer', {
signer: this._filter.signer,
Expand Down Expand Up @@ -361,11 +356,6 @@ export class TransactionService implements ITransactionService {
if (this._filter.workspaceId || this._filter.signer) {
queryBuilder.andWhere(
new Brackets(qb => {
if (this._filter.workspaceId) {
qb.orWhere('workspace.id IN (:...workspace)', {
workspace: this._filter.workspaceId,
});
}
if (this._filter.signer) {
qb.orWhere('members.address = :signer', {
signer: this._filter.signer,
Expand Down
9 changes: 2 additions & 7 deletions packages/api/src/modules/user/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,12 @@ export class UserController {
async meTransactions(req: IMeRequest) {
try {
const { type } = req.query;
const { workspace, user, network } = req;
const { user, network } = req;

const { hasSingle } = await new UserService().workspacesByUser(
workspace,
user,
);
const transactions = await new TransactionService()
.filter({
type,
workspaceId: [workspace.id],
signer: hasSingle ? user.address : undefined,
signer: user.address,
network: network.url,
})
.paginate({ page: '0', perPage: '6' })
Expand Down
Loading