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:
@@ -21,14 +21,12 @@
|
||||
let tags = $state<string[]>(data.article.tags ?? []);
|
||||
let featured = $state(data.article.featured ?? false);
|
||||
let publishDate = $state(
|
||||
data.article.publish_date
|
||||
? new Date(data.article.publish_date).toISOString().slice(0, 16)
|
||||
: "",
|
||||
data.article.publish_date ? new Date(data.article.publish_date).toISOString().slice(0, 16) : "",
|
||||
);
|
||||
let imageId = $state<string | null>(data.article.image ?? null);
|
||||
let saving = $state(false);
|
||||
|
||||
let preview = $derived(content ? marked.parse(content) as string : "");
|
||||
let preview = $derived(content ? (marked.parse(content) as string) : "");
|
||||
|
||||
async function handleImageUpload(files: File[]) {
|
||||
const file = files[0];
|
||||
@@ -98,10 +96,7 @@
|
||||
<div class="space-y-1.5">
|
||||
<Label>Content (Markdown)</Label>
|
||||
<div class="grid grid-cols-2 gap-4 min-h-96">
|
||||
<Textarea
|
||||
bind:value={content}
|
||||
class="h-full min-h-96 font-mono text-sm resize-none"
|
||||
/>
|
||||
<Textarea bind:value={content} class="h-full min-h-96 font-mono text-sm resize-none" />
|
||||
<div
|
||||
class="rounded-lg border border-border/40 bg-muted/20 p-4 overflow-auto prose prose-sm max-w-none prose-headings:text-foreground prose-p:text-muted-foreground"
|
||||
>
|
||||
@@ -117,13 +112,13 @@
|
||||
<div class="space-y-1.5">
|
||||
<Label>Cover image</Label>
|
||||
{#if imageId}
|
||||
<img src={getAssetUrl(imageId, "thumbnail")} alt="" class="h-24 rounded object-cover mb-2" />
|
||||
<img
|
||||
src={getAssetUrl(imageId, "thumbnail")}
|
||||
alt=""
|
||||
class="h-24 rounded object-cover mb-2"
|
||||
/>
|
||||
{/if}
|
||||
<FileDropZone
|
||||
accept="image/*"
|
||||
maxFileSize={10 * MEGABYTE}
|
||||
onUpload={handleImageUpload}
|
||||
/>
|
||||
<FileDropZone accept="image/*" maxFileSize={10 * MEGABYTE} onUpload={handleImageUpload} />
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
let imageId = $state<string | null>(null);
|
||||
let saving = $state(false);
|
||||
|
||||
let preview = $derived(content ? marked.parse(content) as string : "");
|
||||
let preview = $derived(content ? (marked.parse(content) as string) : "");
|
||||
|
||||
function generateSlug(t: string) {
|
||||
return t
|
||||
@@ -87,7 +87,9 @@
|
||||
<Input
|
||||
id="title"
|
||||
bind:value={title}
|
||||
oninput={() => { if (!slug) slug = generateSlug(title); }}
|
||||
oninput={() => {
|
||||
if (!slug) slug = generateSlug(title);
|
||||
}}
|
||||
placeholder="Article title"
|
||||
/>
|
||||
</div>
|
||||
@@ -125,11 +127,7 @@
|
||||
|
||||
<div class="space-y-1.5">
|
||||
<Label>Cover image</Label>
|
||||
<FileDropZone
|
||||
accept="image/*"
|
||||
maxFileSize={10 * MEGABYTE}
|
||||
onUpload={handleImageUpload}
|
||||
/>
|
||||
<FileDropZone accept="image/*" maxFileSize={10 * MEGABYTE} onUpload={handleImageUpload} />
|
||||
{#if imageId}<p class="text-xs text-green-600 mt-1">Image uploaded ✓</p>{/if}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user