Skip to content

Commit 43109e8

Browse files
committed
Merge branch 'feat/ereputation-adapter' of github.com:MetaState-Prototype-Project/prototype into feat/ereputation-adapter
2 parents 044865e + d9b1613 commit 43109e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

platforms/eReputation-api/src/controllers/GroupController.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ export class GroupController {
1616
return res.status(400).json({ error: "Query parameter 'q' is required" });
1717
}
1818

19-
const limitNum = limit ? parseInt(limit as string) : 10;
19+
let limitNum = 10;
20+
if (typeof limit === "string") {
21+
const parsed = parseInt(limit, 10);
22+
if (!Number.isNaN(parsed) && parsed > 0 && parsed <= 100) {
23+
limitNum = parsed;
24+
}
25+
}
26+
2027
const groups = await this.groupService.searchGroups(q, limitNum);
2128

2229
res.json(groups.map(group => ({

0 commit comments

Comments
 (0)