sharkey/src/services/insert-moderation-log.ts

14 lines
383 B
TypeScript
Raw Normal View History

2019-07-14 03:18:45 +09:00
import { ModerationLogs } from '../models';
2021-03-23 17:43:07 +09:00
import { genId } from '@/misc/gen-id';
import { User } from '@/models/entities/user';
2019-07-14 03:18:45 +09:00
export async function insertModerationLog(moderator: { id: User['id'] }, type: string, info?: Record<string, any>) {
2021-03-21 21:27:09 +09:00
await ModerationLogs.insert({
2019-07-14 03:18:45 +09:00
id: genId(),
createdAt: new Date(),
userId: moderator.id,
type: type,
info: info || {}
});
}