mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-29 22:58:18 -05:00
Zod validated config for security and ease of getting started
This commit is contained in:
@@ -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"),
|
||||
}),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user