From f178bb8760b600ca3a3166672dbd76e5e1413316 Mon Sep 17 00:00:00 2001 From: Wesley Finck Date: Fri, 26 Sep 2025 17:59:37 -0700 Subject: [PATCH] make sure handle and record key exist in url params --- .../http/controllers/GetCollectionPageByAtUriController.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/cards/infrastructure/http/controllers/GetCollectionPageByAtUriController.ts b/src/modules/cards/infrastructure/http/controllers/GetCollectionPageByAtUriController.ts index a2beb5d7..fed1177b 100644 --- a/src/modules/cards/infrastructure/http/controllers/GetCollectionPageByAtUriController.ts +++ b/src/modules/cards/infrastructure/http/controllers/GetCollectionPageByAtUriController.ts @@ -5,13 +5,18 @@ import { AuthenticatedRequest } from 'src/shared/infrastructure/http/middleware/ import { CardSortField, SortOrder } from '../../../domain/ICardQueryRepository'; export class GetCollectionPageByAtUriController extends Controller { - constructor(private getCollectionPageByAtUriUseCase: GetCollectionPageByAtUriUseCase) { + constructor( + private getCollectionPageByAtUriUseCase: GetCollectionPageByAtUriUseCase, + ) { super(); } async executeImpl(req: AuthenticatedRequest, res: Response): Promise { try { const { handle, recordKey } = req.params; + if (!handle || !recordKey) { + return this.badRequest(res, 'Handle and recordKey are required'); + } const { page, limit, sortBy, sortOrder } = req.query; const callerDid = req.did; -- 2.51.2