Skip to content

Commit 8aee140

Browse files
committed
feat: add favicon support to domain export and query keys
1 parent a921b94 commit 8aee140

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

hooks/use-domain-export.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type QueryKeys = {
1111
certificates: readonly unknown[];
1212
headers: readonly unknown[];
1313
seo: readonly unknown[];
14+
favicon: readonly unknown[];
1415
};
1516

1617
/**
@@ -64,6 +65,7 @@ export function useDomainExport(domain: string, queryKeys: QueryKeys) {
6465
const certificatesData = queryClient.getQueryData(queryKeys.certificates);
6566
const headersData = queryClient.getQueryData(queryKeys.headers);
6667
const seoData = queryClient.getQueryData(queryKeys.seo);
68+
const faviconData = queryClient.getQueryData(queryKeys.favicon);
6769

6870
// Aggregate into export format
6971
const exportData = {
@@ -73,6 +75,8 @@ export function useDomainExport(domain: string, queryKeys: QueryKeys) {
7375
certificates: certificatesData ?? null,
7476
headers: headersData ?? null,
7577
seo: seoData ?? null,
78+
favicon:
79+
(faviconData as { url: string | null } | undefined)?.url ?? null,
7680
};
7781

7882
// Export with partial data (graceful degradation)

hooks/use-domain-query-keys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function useDomainQueryKeys(domain: string) {
1616
certificates: trpc.domain.certificates.queryOptions({ domain }).queryKey,
1717
headers: trpc.domain.headers.queryOptions({ domain }).queryKey,
1818
seo: trpc.domain.seo.queryOptions({ domain }).queryKey,
19+
favicon: trpc.domain.favicon.queryOptions({ domain }).queryKey,
1920
}),
2021
[trpc, domain],
2122
);

lib/schemas/internal/export.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SeoResponseSchema } from "../domain/seo";
88

99
export const DomainExportSchema = z.object({
1010
domain: z.string(),
11+
favicon: z.string().nullish(),
1112
registration: RegistrationSchema.omit({
1213
domain: true,
1314
unicodeName: true,

0 commit comments

Comments
 (0)