File tree Expand file tree Collapse file tree 4 files changed +23
-17
lines changed
Expand file tree Collapse file tree 4 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ export function JobResult({ jobId }: SearchResultProps) {
5151 </ Link >
5252 </ Button >
5353 ) }
54- { ! ! jobResult . provider && ! ! jobResult . client &&
54+ { ! ! jobResult . provider && ! ! jobResult . client && (
5555 < SlashIcon size = { 12 } />
56- }
56+ ) }
5757
5858 { ! ! jobResult . client && (
5959 < Button className = "text-lg" variant = "link" asChild >
@@ -76,7 +76,7 @@ export function JobResult({ jobId }: SearchResultProps) {
7676 < CardContent className = "grid gap-4" >
7777 { jobResult . results . map ( ( result , index ) => (
7878 < div key = { index } className = "p-3 border rounded-md" >
79- { ( jobResult . provider == null &&
79+ { jobResult . provider == null && (
8080 // for client only jobs, show provider for each result
8181 < Button className = "text-lg" variant = "link" asChild >
8282 < Link
Original file line number Diff line number Diff line change @@ -48,18 +48,20 @@ function isJobResponse(input: unknown): input is URLFinderAPIJobResponse {
4848 return false ;
4949 }
5050
51- const hasValidResults = Array . isArray ( input . results ) && (
52- input . results . length === 0 ||
53- input . results . every ( result =>
54- isPlainObject ( result ) &&
55- typeof result . provider === "string" &&
56- ( result . client === null || typeof result . client === "string" ) &&
57- ( result . working_url === null || typeof result . working_url === "string" ) &&
58- typeof result . retrievability === "number" &&
59- isURLFinderResultCode ( result . result ) &&
60- ( result . error == null || typeof result . error === "string" )
61- )
62- ) ;
51+ const hasValidResults =
52+ Array . isArray ( input . results ) &&
53+ ( input . results . length === 0 ||
54+ input . results . every (
55+ ( result ) =>
56+ isPlainObject ( result ) &&
57+ typeof result . provider === "string" &&
58+ ( result . client === null || typeof result . client === "string" ) &&
59+ ( result . working_url === null ||
60+ typeof result . working_url === "string" ) &&
61+ typeof result . retrievability === "number" &&
62+ isURLFinderResultCode ( result . result ) &&
63+ ( result . error == null || typeof result . error === "string" )
64+ ) ) ;
6365
6466 return (
6567 ( input . client === null || typeof input . client === "string" ) &&
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ interface SearchInput {
1818 client ?: string | null ;
1919}
2020
21- type URLSearchQueryKey = [ QueryKey . SEARCH , string | null | undefined , string | null | undefined ] ;
21+ type URLSearchQueryKey = [
22+ QueryKey . SEARCH ,
23+ string | null | undefined ,
24+ string | null | undefined ,
25+ ] ;
2226
2327export function useURLSearch ( input : SearchInput ) {
2428 const search = useCallback < QueryFunction < SearchResult , URLSearchQueryKey > > (
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export async function parseURLFinderAPIResponseOrThrow(
4040) : Promise < unknown > {
4141 try {
4242 const result = await response . json ( ) ;
43-
43+ console . log ( "Parsed result:" , result ) ;
4444 if ( ! response . ok ) {
4545 const errorMessage = isURLFinderAPIErrorResponse ( result )
4646 ? result . error
You can’t perform that action at this time.
0 commit comments