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 }) }