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:
@@ -87,11 +87,7 @@ builder.mutationField("deleteComment", (t) =>
|
||||
id: t.arg.int({ required: true }),
|
||||
},
|
||||
resolve: async (_root, args, ctx) => {
|
||||
const comment = await ctx.db
|
||||
.select()
|
||||
.from(comments)
|
||||
.where(eq(comments.id, args.id))
|
||||
.limit(1);
|
||||
const comment = await ctx.db.select().from(comments).where(eq(comments.id, args.id)).limit(1);
|
||||
if (!comment[0]) throw new GraphQLError("Comment not found");
|
||||
requireOwnerOrAdmin(ctx, comment[0].user_id);
|
||||
await ctx.db.delete(comments).where(eq(comments.id, args.id));
|
||||
|
||||
Reference in New Issue
Block a user