Skip to content

Commit

Permalink
return manager on get borrower notes (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva authored Aug 7, 2023
1 parent edbb2cb commit 7b76722
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/core/src/database/models/associations/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,10 @@ export function userAssociation(sequelize: Sequelize) {
targetKey: 'id',
as: 'user'
});

microCreditNote.belongsTo(appUser, {
foreignKey: 'managerId',
targetKey: 'id',
as: 'manager'
});
}
2 changes: 1 addition & 1 deletion packages/core/src/services/microcredit/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export default class MicroCreditList {
{
model: models.appUser,
attributes: ['address', 'firstName', 'lastName'],
as: 'user'
as: 'manager'
}
],
where: {
Expand Down

0 comments on commit 7b76722

Please sign in to comment.