Skip to content

Commit

Permalink
fix(grants): added proper support for loading grantees from daoip
Browse files Browse the repository at this point in the history
  • Loading branch information
AndySakov committed Nov 4, 2024
1 parent 207d110 commit 17f676f
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 117 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"iron-session": "^6.3.1",
"joi": "^17.9.2",
"js-convert-case": "^4.2.0",
"js-yaml": "^4.1.0",
"langchain": "^0.2.17",
"lodash": "^4.17.21",
"mime": "^3.0.0",
Expand All @@ -78,6 +79,7 @@
"rxjs": "^7.8.1",
"short-unique-id": "^5.2.0",
"siwe": "^2.1.4",
"sqids": "^0.3.0",
"ts-morph": "^18.0.0",
"uuid": "^9.0.1",
"viem": "^2.9.15"
Expand All @@ -93,6 +95,7 @@
"@semantic-release/git": "^10.0.1",
"@types/express": "^4.17.17",
"@types/jest": "29.5.1",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.17.7",
"@types/multer": "^1.4.7",
"@types/node": "20.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/grants/grants.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ApiUnprocessableEntityResponse,
getSchemaPath,
} from "@nestjs/swagger";
import { responseSchemaWrapper } from "src/shared/helpers";
import { paginate, responseSchemaWrapper } from "src/shared/helpers";
import {
Grant,
Grantee,
Expand Down Expand Up @@ -100,7 +100,9 @@ export class GrantsController {
this.logger.log(
`/grants/${slug}/grantees ${JSON.stringify({ page, limit })}`,
);
return this.grantsService.getGranteesBySlug(slug, page, limit);
return this.grantsService
.getGranteesBySlug(slug)
.then(x => paginate(page, limit, x));
}

@Get(":slug/grantees/:granteeSlug")
Expand Down
3 changes: 2 additions & 1 deletion src/grants/grants.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { GrantsController } from "./grants.controller";
import { GoogleBigQueryModule } from "src/google-bigquery/google-bigquery.module";
import { AuthModule } from "src/auth/auth.module";
import { MailService } from "src/mail/mail.service";
import { ProjectsModule } from "src/projects/projects.module";

@Module({
imports: [GoogleBigQueryModule, AuthModule],
imports: [GoogleBigQueryModule, AuthModule, ProjectsModule],
controllers: [GrantsController],
providers: [GrantsService, MailService],
})
Expand Down
Loading

0 comments on commit 17f676f

Please sign in to comment.