Skip to content
Permalink
f135368dc4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
16 lines (10 sloc) 520 Bytes
import { jsonError, jsonResponse } from "../../common.js";
import precheck from "./precheck.js";
export async function onRequestPost(context: RequestContext) {
const { id }: { id: any } = context.data.body;
if (typeof id !== "number") return jsonError("Invalid user id", 400);
const precheckData = await precheck(context, id);
if (precheckData.error) return jsonError(precheckData.error, 500);
const { can_appeal, reason } = precheckData;
return jsonResponse(JSON.stringify({ can_appeal, reason }));
}