import { ApiCall } from "tsrpc";
import { ReqApply, ResApply } from "../../shared/protocols/kbzz/PtlApply";
import { apply } from './ApiOpen';

export default async function (call: ApiCall<ReqApply, ResApply>) {
    if ((await G.mongodb.cPlayerInfo('kbzzApply').findOne({ uid: call.uid, type: 'kbzzApply' }))?.apply) return call.error('', { code: -1 });
    apply(call.uid);
    call.succ({});
}