From 5272c777a8a30c0ec40ae838eaecb1fef237cbe9 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Mon, 30 Oct 2023 17:01:08 -0400 Subject: [PATCH] Create get all appeal bans endpoint --- functions/api/appeals/bans.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 functions/api/appeals/bans.ts diff --git a/functions/api/appeals/bans.ts b/functions/api/appeals/bans.ts new file mode 100644 index 0000000..11fd9ed --- /dev/null +++ b/functions/api/appeals/bans.ts @@ -0,0 +1,9 @@ +import { jsonResponse } from "../../common.js"; + +export async function onRequestGet(context: RequestContext) { + const { results } = await context.env.D1.prepare( + "SELECT * FROM appeal_bans;", + ).all(); + + return jsonResponse(JSON.stringify(results)); +}