Skip to content

Commit

Permalink
handle types
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadPCh committed Nov 15, 2024
1 parent 8ab203c commit dcee49f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/server-extension/project-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ 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 res;
return rawProjects.map(
(rawProject: {
id: string;
rf_rounds: number[] | null;
total_count: number;
}) => ({
...rawProject,
rfRounds: rawProject.rf_rounds,
})
);
} 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 dcee49f

Please sign in to comment.