app
components
data
functions
api
admin-apps
appeals
auth
data-transfers
events-team
game-appeals
[id]
metadata.ts
precheck.ts
submit.ts
game-bans
gme
inactivity
infractions
me
mod-queue
reports
short-links
uploads
[[path]].ts
coconut.ts
events.ts
webview-captcha.ts
_middleware.ts
common.ts
email.ts
gcloud.ts
permissions.ts
roblox-open-cloud.ts
upload.ts
public
.gitignore
.node-version
.prettierignore
OFL.txt
README.md
emotion-server.js
index.css
index.d.ts
package-lock.json
package.json
remix.config.js
server.ts
theme.ts
tsconfig.json
23 lines
660 B
TypeScript
23 lines
660 B
TypeScript
import { jsonError, jsonResponse } from "../../common.js";
|
|
import precheck from "./precheck.js";
|
|
|
|
export async function onRequestPost(context: RequestContext) {
|
|
if (
|
|
context.request.headers.get("rbx-auth") !==
|
|
context.env.ROBLOX_APPEALS_TOKEN
|
|
)
|
|
return jsonError("Unauthorized", 401);
|
|
|
|
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 }));
|
|
}
|