Skip to content

Commit e819053

Browse files
committed
prettier
1 parent 4f017a5 commit e819053

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

components/job-result.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

hooks/use-job.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff 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") &&

hooks/use-url-search.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

2327
export function useURLSearch(input: SearchInput) {
2428
const search = useCallback<QueryFunction<SearchResult, URLSearchQueryKey>>(

lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)