12 lines
385 B
TypeScript
Raw Normal View History

2021-12-29 22:48:25 +08:00
import { ObjectId } from 'mongodb';
2021-06-26 23:41:37 +08:00
import { ApiCall } from "tsrpc";
import { Global } from "../models/Global";
import { ReqDelPost, ResDelPost } from "../shared/protocols/PtlDelPost";
export async function ApiDelPost(call: ApiCall<ReqDelPost, ResDelPost>) {
let op = await Global.collection('Post').deleteOne({
2021-12-29 22:48:25 +08:00
_id: new ObjectId(call.req._id)
2021-06-26 23:41:37 +08:00
})
call.succ({});
}