Greatly reduce repeated code
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { insertLogs } from "../../../gcloud.js";
|
||||
import { getBanList, setBanList } from "../../../roblox-open-cloud.js";
|
||||
import { insertLogs } from "../../../gcloud.js";
|
||||
import { jsonError } from "../../../common.js";
|
||||
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
const actionMap = context.data.body;
|
||||
@ -13,11 +14,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
action < 0 ||
|
||||
action > 2
|
||||
)
|
||||
return new Response('{"error":"Invalid action map"}', {
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
});
|
||||
return jsonError("Invalid action map", 400);
|
||||
|
||||
if (action === 0) continue;
|
||||
|
||||
|
Reference in New Issue
Block a user