From 2930327f4dfdf1fb85a4d59f1737f54078a0c694 Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 3 Sep 2024 05:58:30 +0330 Subject: [PATCH 1/4] Change review status default value to listed --- src/entities/project.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entities/project.ts b/src/entities/project.ts index de0bb8223..362beaedf 100644 --- a/src/entities/project.ts +++ b/src/entities/project.ts @@ -423,7 +423,7 @@ export class Project extends BaseEntity { @Column({ type: 'enum', enum: ReviewStatus, - default: ReviewStatus.NotReviewed, + default: ReviewStatus.Listed, }) reviewStatus: ReviewStatus; From 233b9548e3743f1152db679d2d3fe83a9f8ff482 Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 3 Sep 2024 06:01:43 +0330 Subject: [PATCH 2/4] Change review status value to listed in activateProject endPoint --- src/resolvers/projectResolver.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/resolvers/projectResolver.ts b/src/resolvers/projectResolver.ts index f01909a98..a7ced69f3 100644 --- a/src/resolvers/projectResolver.ts +++ b/src/resolvers/projectResolver.ts @@ -1118,8 +1118,8 @@ export class ProjectResolver { } project.qualityScore = qualityScore; project.updatedAt = new Date(); - project.listed = null; - project.reviewStatus = ReviewStatus.NotReviewed; + project.listed = true; + project.reviewStatus = ReviewStatus.Listed; // if (newProjectData.icon !== undefined) { // project.icon = newProjectData.icon; @@ -1364,6 +1364,7 @@ export class ProjectResolver { } const slug = await getAppropriateSlug(slugBase); + // if we don't get isDraft, we set the status to active const status = await this.projectStatusRepository.findOne({ where: { id: projectInput.isDraft ? ProjStatus.drafted : ProjStatus.active, @@ -2145,8 +2146,8 @@ export class ProjectResolver { user, }); - project.listed = null; - project.reviewStatus = ReviewStatus.NotReviewed; + project.listed = true; + project.reviewStatus = ReviewStatus.Listed; await project.save(); From 6a6a87bd21805bde09884dd9938f1f43035ad31e Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 3 Sep 2024 06:06:47 +0330 Subject: [PATCH 3/4] make project listed by default --- src/resolvers/projectResolver.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/resolvers/projectResolver.ts b/src/resolvers/projectResolver.ts index a7ced69f3..9bf9c87b2 100644 --- a/src/resolvers/projectResolver.ts +++ b/src/resolvers/projectResolver.ts @@ -1419,6 +1419,9 @@ export class ProjectResolver { verified: false, giveBacks: false, adminUser: user, + // make project listed by default + listed: true, + reviewStatus: ReviewStatus.Listed, }); await project.save(); From a7d51cb58e0f7a5abe1cd0fe22053151166f99a7 Mon Sep 17 00:00:00 2001 From: ali ebrahimi Date: Tue, 3 Sep 2024 06:09:06 +0330 Subject: [PATCH 4/4] fix the tests --- src/resolvers/projectResolver.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/resolvers/projectResolver.test.ts b/src/resolvers/projectResolver.test.ts index ce0fb6162..b71202a45 100644 --- a/src/resolvers/projectResolver.test.ts +++ b/src/resolvers/projectResolver.test.ts @@ -459,11 +459,10 @@ function createProjectTestCases() { ORGANIZATION_LABELS.GIVETH, ); - // When creating project, listed is null by default - assert.equal(result.data.data.createProject.listed, null); + assert.equal(result.data.data.createProject.listed, true); assert.equal( result.data.data.createProject.reviewStatus, - ReviewStatus.NotReviewed, + ReviewStatus.Listed, ); assert.equal( @@ -568,11 +567,10 @@ function createProjectTestCases() { ORGANIZATION_LABELS.GIVETH, ); - // When creating project, listed is null by default - assert.equal(result.data.data.createProject.listed, null); + assert.equal(result.data.data.createProject.listed, true); assert.equal( result.data.data.createProject.reviewStatus, - ReviewStatus.NotReviewed, + ReviewStatus.Listed, ); assert.equal(