UI for log rows

This commit is contained in:
shatfield4 2024-02-02 18:32:20 -08:00
parent 0b313e7078
commit dac7c355d4
1 changed files with 1 additions and 7 deletions

View File

@ -1,19 +1,13 @@
const prisma = require("../utils/prisma");
const EventLogs = {
logEvent: async function (
event,
metadata = {},
userId = null,
ipAddress = null
) {
logEvent: async function (event, metadata = {}, userId = null) {
try {
const eventLog = await prisma.event_logs.create({
data: {
event,
metadata: metadata ? JSON.stringify(metadata) : null,
userId: userId ? Number(userId) : null,
ipAddress: ipAddress ? ipAddress : null,
occurredAt: new Date(),
},
});