mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-07 11:46:09 -05:00
Add logs to banning/unbanning
This commit is contained in:
@@ -9,6 +9,7 @@ import { assertUnreachable } from "~/utils/types";
|
||||
import { _action, actualNumber } from "~/utils/zod";
|
||||
import { plusTiersFromVotingAndLeaderboard } from "../core/plus-tier.server";
|
||||
import { refreshBannedCache } from "~/features/ban/core/banned.server";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
export const action = async ({ request }: ActionFunctionArgs) => {
|
||||
const data = await parseRequestFormData({
|
||||
@@ -86,6 +87,15 @@ export const action = async ({ request }: ActionFunctionArgs) => {
|
||||
|
||||
refreshBannedCache();
|
||||
|
||||
logger.info("Banned user", {
|
||||
userId: data["user"],
|
||||
byUserId: user.id,
|
||||
reason: data.reason,
|
||||
duration: data.duration
|
||||
? new Date(data.duration).toLocaleString()
|
||||
: undefined,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
case "UNBAN_USER": {
|
||||
@@ -95,6 +105,11 @@ export const action = async ({ request }: ActionFunctionArgs) => {
|
||||
|
||||
refreshBannedCache();
|
||||
|
||||
logger.info("Unbanned user", {
|
||||
userId: data["user"],
|
||||
byUserId: user.id,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user