import {ApiCall} from "tsrpc";
import {ReqDelCrossEmail, ResDelCrossEmail} from "../../cross/protocols/email/PtlDelCrossEmail";

export default async function (call: ApiCall<ReqDelCrossEmail, ResDelCrossEmail>) {
    let eids = call.req.eids;
    G.mongodb.collection("email").updateMany({
        _id: {$in: eids.map((i) => G.mongodb.conversionId(i))}
    }, {$set: {isdel: true}})

    call.succ({result:true})
}