fix: resolve lint errors from ACL/admin implementation
- Remove unused requireOwnerOrAdmin import from videos.ts - Remove unused requireAuth import from users.ts - Remove unused GraphQLError import from articles.ts - Replace URLSearchParams with SvelteURLSearchParams in admin users page - Apply prettier formatting to all changed files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
files,
|
||||
} from "../../db/schema/index";
|
||||
import { eq, and, lte, desc, inArray, count } from "drizzle-orm";
|
||||
import { requireRole, requireOwnerOrAdmin } from "../../lib/acl";
|
||||
import { requireRole } from "../../lib/acl";
|
||||
|
||||
async function enrichVideo(db: any, video: any) {
|
||||
// Fetch models
|
||||
@@ -433,10 +433,7 @@ builder.queryField("adminListVideos", (t) =>
|
||||
type: [VideoType],
|
||||
resolve: async (_root, _args, ctx) => {
|
||||
requireRole(ctx, "admin");
|
||||
const rows = await ctx.db
|
||||
.select()
|
||||
.from(videos)
|
||||
.orderBy(desc(videos.upload_date));
|
||||
const rows = await ctx.db.select().from(videos).orderBy(desc(videos.upload_date));
|
||||
return Promise.all(rows.map((v: any) => enrichVideo(ctx.db, v)));
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user