Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: search and ask AI #2889

Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Fix TS
  • Loading branch information
SamyPesse committed Feb 27, 2025
commit 19713e6dab84a4f8ab399d13381442e241f6ef7a
18 changes: 6 additions & 12 deletions packages/gitbook-v2/src/lib/data/api.ts
Original file line number Diff line number Diff line change
@@ -514,24 +514,18 @@ async function getEmbedByUrl(

async function searchSiteContent(
input: DataFetcherInput,
params: Parameters<GitBookAPI['orgs']['searchSiteContent']>[2] & {
organizationId: string;
siteId: string;
/** Cache bust to ensure the search results are fresh when the space is updated. */
cacheBust?: string;
}
params: Parameters<GitBookDataFetcher['searchSiteContent']>[0]
) {
'use cache';

const { organizationId, siteId, ...rest } = params;
const { organizationId, siteId, query, scope } = params;

cacheLife('days');

const res = await getAPI(input).orgs.searchSiteContent(
params.organizationId,
params.siteId,
rest
);
const res = await getAPI(input).orgs.searchSiteContent(organizationId, siteId, {
query,
...scope,
});
return res.data.items;
}

Loading
Oops, something went wrong.