sharkey/packages/backend/src/services/insert-moderation-log.ts
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00

14 lines
398 B
TypeScript

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