Zod validated config for security and ease of getting started

This commit is contained in:
Kalle
2026-06-15 14:12:15 +03:00
parent 215243e071
commit 75179e5077
46 changed files with 386 additions and 275 deletions

View File

@@ -14,7 +14,6 @@ import {
import { errorIsSqliteForeignKeyConstraintFailure } from "~/utils/sql";
import { assertUnreachable } from "~/utils/types";
import { _action, actualNumber, friendCode } from "~/utils/zod";
import * as AdminNotifications from "../core/admin-notifications.server";
import { plusTiersFromVotingAndLeaderboard } from "../core/plus-tier.server";
export const action = async ({ request }: ActionFunctionArgs) => {
@@ -170,14 +169,6 @@ export const action = async ({ request }: ActionFunctionArgs) => {
message = "API access granted";
break;
}
case "TEST_ADMIN_NOTIFICATION": {
requireRole("ADMIN");
await AdminNotifications.send("Test notification from admin panel");
message = "Test notification sent";
break;
}
default: {
assertUnreachable(data);
}
@@ -240,7 +231,4 @@ export const adminActionSchema = z.union([
_action: _action("API_ACCESS"),
user: z.preprocess(actualNumber, z.number().positive()),
}),
z.object({
_action: _action("TEST_ADMIN_NOTIFICATION"),
}),
]);