fix audit log in api route

This commit is contained in:
Lea 2024-01-24 10:00:50 +01:00
parent c9837a6bd4
commit 0304ec657a
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -1,5 +1,5 @@
import apiAuth from "@/lib/apiAuth";
import { auditLog } from "@/lib/audit";
import { auditLogRaw } from "@/lib/audit";
import { AliasEntry, createAliasEntry } from "@/lib/db";
import { generateAliasEmail } from "@/lib/util-server";
import { NextResponse } from "next/server";
@ -72,7 +72,12 @@ export async function POST(request: Request) {
temporary: true,
};
auditLog("createTempAlias", alias);
await auditLogRaw({
action: "createTempAlias",
ts: new Date().toISOString(),
data: alias,
user: user,
});
return NextResponse.json(alias);
});
}