From 1c37bc0ef0550eb017b618243a76f6daaa1cee62 Mon Sep 17 00:00:00 2001 From: kkatusic Date: Mon, 13 Jan 2025 12:20:06 +0100 Subject: [PATCH] fix/removing endaomentId from update --- src/entities/project.ts | 3 --- src/services/cronJobs/checkAndUpdateEndaomentProject.ts | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entities/project.ts b/src/entities/project.ts index 2c3d88fd1..f6c587c22 100644 --- a/src/entities/project.ts +++ b/src/entities/project.ts @@ -702,9 +702,6 @@ export class ProjectUpdate extends BaseEntity { @Column('text', { nullable: true }) managingFundDescription: string; - @Column('uuid', { nullable: true, unique: true }) - endaomentId?: string; - @Field(_type => FeaturedUpdate, { nullable: true }) @OneToOne( _type => FeaturedUpdate, diff --git a/src/services/cronJobs/checkAndUpdateEndaomentProject.ts b/src/services/cronJobs/checkAndUpdateEndaomentProject.ts index 560bb4308..0c726d2ef 100644 --- a/src/services/cronJobs/checkAndUpdateEndaomentProject.ts +++ b/src/services/cronJobs/checkAndUpdateEndaomentProject.ts @@ -1,5 +1,6 @@ import axios from 'axios'; import { schedule } from 'node-cron'; +import { Not } from 'typeorm'; import config from '../../config'; import { Project, ProjStatus } from '../../entities/project'; import { logger } from '../../utils/logger'; @@ -20,7 +21,9 @@ export const runCheckAndUpdateEndaomentProject = async () => { logger.debug('runCheckAndUpdateEndaomentProject() has been started'); try { // Fetch all projects with organizationId = 5 - const projects = await Project.find({ where: { organizationId: 5 } }); + const projects = await Project.find({ + where: { organizationId: 5, statusId: Not(ProjStatus.cancelled) }, + }); for (const project of projects) { try {