Skip to content

Commit

Permalink
return rfRounds
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadPCh committed Nov 15, 2024
1 parent a4a6e80 commit 8ab203c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server-extension/project-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class ProjectResolver {
const query = `
SELECT
project.id,
project.rf_rounds,
SUM(organisation_project.count) AS total_count
FROM
project
Expand All @@ -90,8 +91,12 @@ export class ProjectResolver {

// Execute the query with parameters
const rawProjects = await manager.query(query, parameters);
const res = rawProjects.map((rawProject: any) => ({
rfRounds: rawProject.rf_rounds,
...rawProject,
}));

return rawProjects;
return res;
} catch (error) {
console.error("Error fetching and sorting projects:", error);
throw new Error("Failed to fetch and sort projects");
Expand Down

0 comments on commit 8ab203c

Please sign in to comment.