Commit ddfbaa0c authored by qinhaitao's avatar qinhaitao

fix: 🐛 checkBug

parent b3b53ede
...@@ -6,7 +6,7 @@ import { DRAW_STATUS, PRIZE_TYPE } from '../../../constants' ...@@ -6,7 +6,7 @@ import { DRAW_STATUS, PRIZE_TYPE } from '../../../constants'
import { dbFindOne } from '../mongodb' import { dbFindOne } from '../mongodb'
import { AWARDS_DB_NAME } from '../../../db' import { AWARDS_DB_NAME } from '../../../db'
export default async function checkValidPrize(prizeTypes: number[]) { export default function checkValidPrize(prizeTypes: number[]) {
return async (context: IContext<{ id: string }>, { activityInfo }: IControllerInfos) => { return async (context: IContext<{ id: string }>, { activityInfo }: IControllerInfos) => {
const { id } = context.data const { id } = context.data
let awardInfo = await dbFindOne<IAwards>(context, AWARDS_DB_NAME, { let awardInfo = await dbFindOne<IAwards>(context, AWARDS_DB_NAME, {
...@@ -33,10 +33,6 @@ export default async function checkValidPrize(prizeTypes: number[]) { ...@@ -33,10 +33,6 @@ export default async function checkValidPrize(prizeTypes: number[]) {
} }
} }
export async function checkValidObjectPrize(context: IContext<{ id: string }>, { activityInfo }: IControllerInfos) { export const checkValidObjectPrize = checkValidPrize([PRIZE_TYPE.OBJECT])
return await checkValidPrize([PRIZE_TYPE.OBJECT])
}
export async function checkValidEnamePrize(context: IContext<{ id: string }>, { activityInfo }: IControllerInfos) { export const checkValidEnamePrize = checkValidPrize([PRIZE_TYPE.ENAME, PRIZE_TYPE.CREDITS])
return await checkValidPrize([PRIZE_TYPE.ENAME, PRIZE_TYPE.CREDITS])
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment