feat: add initial recommendation data
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { BadRequestError } from "@lib/errors.ts";
|
||||
import { resources } from "@lib/resources.ts";
|
||||
import { SearchResult } from "@lib/types.ts";
|
||||
import { getTypeSenseClient } from "@lib/typesense.ts";
|
||||
@@ -15,9 +14,9 @@ type SearchParams = {
|
||||
query_by?: string;
|
||||
};
|
||||
|
||||
export function parseResourceUrl(_url: string): SearchParams | undefined {
|
||||
export function parseResourceUrl(_url: string | URL): SearchParams | undefined {
|
||||
try {
|
||||
const url = new URL(_url);
|
||||
const url = typeof _url === "string" ? new URL(_url) : _url;
|
||||
let query = url.searchParams.get("q") || "*";
|
||||
if (!query) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user