feat: make author clickable
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { BadRequestError } from "@lib/errors.ts";
|
||||
import { resources } from "@lib/resources.ts";
|
||||
import { ResourceStatus } from "@lib/types.ts";
|
||||
import { ResourceStatus, SearchResult } from "@lib/types.ts";
|
||||
import { getTypeSenseClient } from "@lib/typesense.ts";
|
||||
import { extractHashTags } from "@lib/string.ts";
|
||||
|
||||
@@ -11,6 +11,7 @@ type SearchParams = {
|
||||
type?: ResourceType;
|
||||
tags?: string[];
|
||||
status?: ResourceStatus;
|
||||
author?: string;
|
||||
query_by?: string;
|
||||
};
|
||||
|
||||
@@ -44,7 +45,7 @@ export function parseResourceUrl(_url: string): SearchParams | undefined {
|
||||
export async function searchResource(
|
||||
{ q, query_by = "name,description,author,tags", tags = [], type, status }:
|
||||
SearchParams,
|
||||
) {
|
||||
): Promise<SearchResult> {
|
||||
const typesenseClient = await getTypeSenseClient();
|
||||
if (!typesenseClient) {
|
||||
throw new Error("Query not available");
|
||||
|
||||
Reference in New Issue
Block a user