fix: satisfy next build ESLint in admin-api (unused param)

next build runs ESLint (stricter than tsc --noEmit), which failed on the
unused `type` param in fetchCategories with no-unused-vars, breaking the
frontend production build. Reference it via `void type;` while keeping
the signature for API compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-30 05:45:10 +03:30
parent 7f03ad1d03
commit e8c1587695
+3 -2
View File
@@ -164,10 +164,11 @@ function flattenCategories(nodes: V2Category[]): AdminCategory[] {
// ── Public API ──────────────────────────────────────────────────────────────── // ── Public API ────────────────────────────────────────────────────────────────
export async function fetchCategories( export async function fetchCategories(
_type?: "video" | "image" type?: "video" | "image"
): Promise<AdminCategory[]> { ): Promise<AdminCategory[]> {
// V2 categories have no video/image type; `_type` is accepted for API // V2 categories have no video/image type; `type` is accepted for API
// compatibility but the content service returns a single tree. // compatibility but the content service returns a single tree.
void type;
const tree = await safeGet<V2Category[]>("/v1/categories"); const tree = await safeGet<V2Category[]>("/v1/categories");
return tree ? flattenCategories(tree) : []; return tree ? flattenCategories(tree) : [];
} }