monkeeShark/packages/backend/src/services/insert-moderation-log.ts
2021-12-09 23:58:30 +09:00

13 lines
389 B
TypeScript

import { ModerationLogs } from '@/models/index';
import { genId } from '@/misc/gen-id';
import { User } from '@/models/entities/user';
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 || {},
});
}