Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/pages/project/search/titles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "../../../../error.ts";

/**
* Options for {@linkcode get}
* Options for {@linkcode getLinks}
*
* @experimental **UNSTABLE**: New API, yet to be vetted.
*/
Expand All @@ -33,7 +33,7 @@ export interface GetLinksOptions<R extends Response | undefined>
* @param options - Additional configuration options
* @returns A {@linkcode Request} object for fetching link data
*/
export const makeGetRequest = <R extends Response | undefined>(
export const makeGetLinksRequest = <R extends Response | undefined>(
project: string,
options?: GetLinksOptions<R>,
): Request => {
Expand All @@ -59,7 +59,7 @@ export const makeGetRequest = <R extends Response | undefined>(
* @param options Additional configuration options for the request
* @returns A {@linkcode Response} object containing the link data
*/
export const get = <R extends Response | undefined = Response>(
export const getLinks = <R extends Response | undefined = Response>(
project: string,
options?: GetLinksOptions<R>,
): Promise<
Expand All @@ -72,7 +72,7 @@ export const get = <R extends Response | undefined = Response>(
}, R>
> =>
setDefaults(options ?? {}).fetch(
makeGetRequest(project, options),
makeGetLinksRequest(project, options),
) as Promise<
ResponseOfEndpoint<{
200: SearchedTitle[];
Expand All @@ -92,13 +92,13 @@ export const get = <R extends Response | undefined = Response>(
* @returns An async generator that yields each link data
* @throws {TypedError<"NotLoggedInError" | "NotMemberError" | "NotFoundError" | "InvalidFollowingIdError"> | HTTPError}
*/
export async function* list(
export async function* getLinksStream(
project: string,
options?: GetLinksOptions<Response>,
): AsyncGenerator<SearchedTitle, void, unknown> {
let followingId = options?.followingId ?? "";
do {
const response = await get(project, { ...options, followingId });
const response = await getLinks(project, { ...options, followingId });
switch (response.status) {
case 200:
break;
Expand Down