refactor: align article author with VideoModel, streamline selects, fix flyout inert
- Remove ArticleAuthor type; article.author now reuses VideoModel (id, artist_name, slug, avatar) - updateArticle accepts authorId; author selectable in admin article edit page - Article edit: single Select with bind:value + $derived selectedAuthor display - Video edit: replace pill toggles with Select type="multiple" bind:value for models - Video table: replace inline badge spans with Badge component - Magazine: display artist_name throughout, author bio links to model profile - Fix flyout aria-hidden warning: replace with inert attribute Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { adminListArticles } from "$lib/services";
|
||||
import { adminListArticles, adminListUsers } from "$lib/services";
|
||||
import { error } from "@sveltejs/kit";
|
||||
|
||||
export async function load({ params, fetch, cookies }) {
|
||||
const token = cookies.get("session_token") || "";
|
||||
const articles = await adminListArticles(fetch, token).catch(() => []);
|
||||
const [articles, modelsResult] = await Promise.all([
|
||||
adminListArticles(fetch, token).catch(() => []),
|
||||
adminListUsers({ role: "model", limit: 200 }, fetch, token).catch(() => ({ items: [], total: 0 })),
|
||||
]);
|
||||
const article = articles.find((a) => a.id === params.id);
|
||||
if (!article) throw error(404, "Article not found");
|
||||
return { article };
|
||||
return { article, authors: modelsResult.items };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user