fix: db.execute usage change
This commit is contained in:
@@ -4,7 +4,8 @@ import { auditLog, user } from "@/lib/db/schema";
|
||||
import AuditLogViewer from "./client";
|
||||
|
||||
export default async function AuditLogViewerPage() {
|
||||
const logs = (await db.execute(sql`
|
||||
const logs = (
|
||||
await db.execute(sql`
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT *
|
||||
@@ -13,7 +14,8 @@ export default async function AuditLogViewerPage() {
|
||||
LIMIT 1000
|
||||
) t
|
||||
ORDER BY id ASC;
|
||||
`)) as (typeof auditLog.$inferSelect)[];
|
||||
`)
|
||||
).rows as (typeof auditLog.$inferSelect)[];
|
||||
const users = await db
|
||||
.select({ name: user.name, email: user.email })
|
||||
.from(user);
|
||||
|
||||
@@ -42,7 +42,8 @@ export default async function AdminLayout({
|
||||
}) {
|
||||
if (!(await adminCheck()))
|
||||
redirect(`/login?next=${encodeURIComponent("/artifact/admin")}`);
|
||||
const subs = (await db.execute(sql`
|
||||
const subs = (
|
||||
await db.execute(sql`
|
||||
WITH max_checked AS (
|
||||
SELECT MAX(queue) AS max_queue
|
||||
FROM artifact.submissions
|
||||
@@ -62,7 +63,8 @@ export default async function AdminLayout({
|
||||
|
||||
ELSE s.queue
|
||||
END,
|
||||
s.id;`)) as (typeof submissions.$inferSelect)[];
|
||||
s.id;`)
|
||||
).rows as (typeof submissions.$inferSelect)[];
|
||||
const config = await getArtifactConfig();
|
||||
const count = await db
|
||||
.select({ a: sql`NULL` })
|
||||
|
||||
Reference in New Issue
Block a user