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