Skip to content

Commit

Permalink
mass confirm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Jul 22, 2024
1 parent a5aaeb1 commit c4bdc59
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
4 changes: 3 additions & 1 deletion src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class NeedController {
!toBeConfirmed ||
!toBeConfirmed.list[0] ||
!toBeConfirmed.createdAt ||
timeDifference(toBeConfirmed.createdAt, new Date()).mm >= 1;
timeDifference(toBeConfirmed.createdAt, new Date()).mm >= 5;
console.log(`Mass prepare expired: ${expired}`);
console.log(
`Last prepare: ${
Expand Down Expand Up @@ -339,6 +339,8 @@ export class NeedController {
fetchedNeed.status !== need.status ||
fetchedNeed.category !== need.category ||
fetchedNeed.type !== need.type ||
fetchedNeed.details !== need.details ||
fetchedNeed.information !== need.informations ||
fetchedNeed.nameTranslations.en !== need.name_translations.en
) {
const { need: nestNeed } = await this.syncService.syncNeed(
Expand Down
44 changes: 23 additions & 21 deletions src/features/need/need.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,27 +375,29 @@ export class NeedService {
.andWhere('need.status = :statusNotPaid', {
statusNotPaid: PaymentStatusEnum.NOT_PAID,
})
.select([
'child.sayname_translations',
'ngo.id',
'ngo.name',
'need.id',
'need.child_id',
'need.created_by_id',
'need.name_translations',
'need.description_translations',
'need.title',
'need.imageUrl',
'need.category',
'need.type',
'need.link',
'need.status',
'need.img',
'need._cost',
'need.isDeleted',
'need.created',
'need.confirmDate',
])
// .select([
// 'child.sayname_translations',
// 'ngo.id',
// 'ngo.name',
// 'need.id',
// 'need.child_id',
// 'need.created_by_id',
// 'need.name_translations',
// 'need.description_translations',
// 'need.title',
// 'need.imageUrl',
// 'need.category',
// 'need.type',
// 'need.link',
// 'need.status',
// 'need.img',
// 'need._cost',
// 'need.details',
// 'need.informations',
// 'need.isDeleted',
// 'need.created',
// 'need.confirmDate',
// ])
.cache(60000)
.orderBy('need.created', 'ASC');
return await queryBuilder.getManyAndCount();
Expand Down

0 comments on commit c4bdc59

Please sign in to comment.