import { ApiCall } from "tsrpc";
import { FightFun } from '../../public/fight';
import { ReqGetInfo, ResGetInfo } from "../../shared/protocols/user/PtlGetInfo";

export default async function (call: ApiCall<ReqGetInfo, ResGetInfo>) {

    if (await G.mongodb.collection('user').findOne({ uid: call.req.uid }) == null) return call.error(globalThis.lng.user_3);

    call.succ({
        ... await FightFun.getPlayerFightData(call.req.uid)
    });
}