From 156a4fc245e6f7465ea328192ef5120710e2dbc7 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:13:11 +0800 Subject: [PATCH] bug fix: enhance list param error --- src/controllers/chest.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/chest.controller.ts b/src/controllers/chest.controller.ts index db76ee6..c584995 100644 --- a/src/controllers/chest.controller.ts +++ b/src/controllers/chest.controller.ts @@ -74,12 +74,12 @@ class BoxController extends BaseController { if (chestid && !isObjectIdString(chestid)) { throw new ZError(11, 'invalid chest id') } - if (!code && !chestId) { + if (!code && !chestid) { throw new ZError(11, 'must provide share code or chest id') } let chest: any - if (chestId) { - chest = await ActivityChest.findById(chestId) + if (chestid) { + chest = await ActivityChest.findById(chestid) } else { chest = await ActivityChest.findOne({ shareCode: code }) }