refactor: replace all explicit any types with proper TypeScript types
Backend resolvers: typed enrichArticle/enrichVideo/enrichModel with DB and $inferSelect types, SQL<unknown>[] for conditions arrays, proper enum casts for status/role fields, $inferInsert for .set() updates, typed raw SQL result rows in gamification, ReplyLike interface for ctx.reply in auth. Frontend: typed catch blocks with Error/interface casts, isActiveLink param, adminGetUser response, tags filter callback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
isMobileMenuOpen = false;
|
||||
}
|
||||
|
||||
function isActiveLink(link: any) {
|
||||
function isActiveLink(link: { name: string; href: string }) {
|
||||
return (
|
||||
(page.url.pathname === "/" && link === navLinks[0]) ||
|
||||
(page.url.pathname.startsWith(link.href) && link !== navLinks[0])
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
{title}
|
||||
</h1>
|
||||
{#if description}
|
||||
<p class="text-xl md:text-2xl text-muted-foreground mb-10 leading-relaxed max-w-4xl mx-auto">
|
||||
<p
|
||||
class="text-xl md:text-2xl text-muted-foreground mb-10 leading-relaxed max-w-4xl mx-auto"
|
||||
>
|
||||
{description}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return "text-green-400 bg-green-400/20";
|
||||
case "draft":
|
||||
return "text-yellow-400 bg-yellow-400/20";
|
||||
default:
|
||||
default:
|
||||
return "text-gray-400 bg-gray-400/20";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,9 @@ export async function adminGetUser(userId: string, token?: string) {
|
||||
"adminGetUser",
|
||||
async () => {
|
||||
const client = token ? getAuthClient(token) : getGraphQLClient();
|
||||
const data = await client.request<{ adminGetUser: any }>(ADMIN_GET_USER_QUERY, { userId });
|
||||
const data = await client.request<{
|
||||
adminGetUser: User & { photos: Array<{ id: string; filename: string }> };
|
||||
}>(ADMIN_GET_USER_QUERY, { userId });
|
||||
return data.adminGetUser;
|
||||
},
|
||||
{ userId },
|
||||
|
||||
Reference in New Issue
Block a user