Skip to content

Commit

Permalink
admin apis
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 24, 2023
1 parent c3debae commit 29bd91c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class NeedController {
}
const accessToken = config().dataCache.fetchPanelAuthentication(25).token;

const allNeeds = await this.needService.getNeedsPaidOnly();
const allNeeds = await this.needService.getNeedsWithSignatures();
const filteredNeeds = allNeeds.filter(
(n) =>
!n.purchaser ||
Expand Down Expand Up @@ -321,7 +321,7 @@ export class NeedController {
flaskUserId: flaskPurchaser.id,
birthDate:
flaskPurchaser.birth_date && new Date(flaskPurchaser.birth_date),
panelRole: PanelContributors.AUDITOR,
panelRole: PanelContributors.PURCHASER,
userName: flaskPurchaser.userName,
};
const purchaserNgo = await this.syncService.syncContributorNgo(
Expand Down Expand Up @@ -366,6 +366,9 @@ export class NeedController {
throw new ServerError('huuuuh');
}
if (purchaser.flaskUserId === 22) {
console.log(purchaser);
console.log(purchaserId);
console.log(statuses);
console.log(flaskNeed);

throw new ServerError('huuuuh');
Expand Down
6 changes: 5 additions & 1 deletion src/features/need/need.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,18 @@ export class NeedService {
});
}

getNeedsPaidOnly(): Promise<NeedEntity[]> {
getNeedsWithSignatures(): Promise<NeedEntity[]> {
return this.needRepository.find({
relations: {
child: true,
verifiedPayments: true,
signatures: true,
},
where: {
status: MoreThan(PaymentStatusEnum.PARTIAL_PAY),
signatures: {
flaskNeedId: MoreThan(0),
},
},
});
}
Expand Down

0 comments on commit 29bd91c

Please sign in to comment.