chore: remove dead files flagged by knip
Delete two unreachable files with no importers: - src/components/ui/dropdown-menu.tsx - src/lib/admin/verify-interactions.ts
This commit is contained in:
1 parent
c7ba04bda1
commit
02f8ffc0bc
2 files changed
-302
No files matched your search
@@ -1,40 +0,0 @@
|
||||
export const VERIFY_INTERACTIONS_URL = "/api/admin/import/furni/verify";
|
||||
|
||||
export interface VerifyInteractionsResult {
|
||||
fixed: number;
|
||||
checked: number;
|
||||
skipped: number;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
type AdminFetcher = (
|
||||
input: RequestInfo | URL,
|
||||
init?: RequestInit,
|
||||
) => Promise<Response>;
|
||||
|
||||
export async function requestVerifyInteractions(
|
||||
fetcher: AdminFetcher,
|
||||
): Promise<VerifyInteractionsResult> {
|
||||
const response = await fetcher(VERIFY_INTERACTIONS_URL, { method: "POST" });
|
||||
const payload = (await response.json()) as Record<string, unknown>;
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
typeof payload.error === "string"
|
||||
? payload.error
|
||||
: "Interaction verification failed",
|
||||
);
|
||||
}
|
||||
|
||||
const errors = Array.isArray(payload.errors)
|
||||
? payload.errors.filter(
|
||||
(value): value is string => typeof value === "string",
|
||||
)
|
||||
: [];
|
||||
|
||||
return {
|
||||
fixed: Number(payload.fixed) || 0,
|
||||
checked: Number(payload.checked) || 0,
|
||||
skipped: Number(payload.skipped) || 0,
|
||||
errors,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user