feat: add search functionality to campaigns list with debounce effect

This commit is contained in:
Dries Augustyns
2026-05-09 09:10:17 +02:00
parent fadc19d139
commit d11495061d
3 changed files with 115 additions and 80 deletions
+2
View File
@@ -64,6 +64,7 @@ export class Campaigns {
private async list(req: Request, res: Response, _next: NextFunction) {
const auth = res.locals.auth;
const status = req.query.status as CampaignStatus | undefined;
const search = typeof req.query.search === 'string' ? req.query.search.trim() || undefined : undefined;
const page = parseInt(req.query.page as string) || 1;
const pageSize = parseInt(req.query.pageSize as string) || 20;
@@ -74,6 +75,7 @@ export class Campaigns {
const result = await CampaignService.list(auth.projectId, {
status,
search,
page,
pageSize,
});