hippofish/packages/backend/src/services/insert-moderation-log.ts
naskya f60ff2eaf4
refactor (backend-rs): rewrite id generator
Co-authored-by: sup39 <dev@sup39.dev>
2024-04-12 05:20:45 +09:00

17 lines
403 B
TypeScript

import { ModerationLogs } from "@/models/index.js";
import { genId } from "backend-rs";
import type { User } from "@/models/entities/user.js";
export async function insertModerationLog(
moderator: { id: User["id"] },
type: string,
info?: Record<string, any>,
) {
await ModerationLogs.insert({
id: genId(),
createdAt: new Date(),
userId: moderator.id,
type: type,
info: info || {},
});
}