Skip to content

Commit a820739

Browse files
authored
Remove ununsed search api lib methods (#2855)
1 parent 3040420 commit a820739

File tree

2 files changed

+5
-49
lines changed

2 files changed

+5
-49
lines changed

.changeset/beige-spoons-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Remove unused search api method from gitbook/api/lib

packages/gitbook/src/lib/api.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,55 +1066,6 @@ export async function getSpaceContentData(
10661066
};
10671067
}
10681068

1069-
/**
1070-
* Search content in a space.
1071-
*/
1072-
export const searchSpaceContent = cache({
1073-
name: 'api.searchSpaceContent',
1074-
tag: (spaceId) => getAPICacheTag({ tag: 'space', space: spaceId }),
1075-
getKeySuffix: getAPIContextId,
1076-
get: async (
1077-
spaceId: string,
1078-
/** The revision ID is used as a cache bust key, to avoid revalidating lot of cache entries by tags */
1079-
revisionId: string,
1080-
query: string,
1081-
options: CacheFunctionOptions,
1082-
) => {
1083-
const apiCtx = await api();
1084-
const response = await apiCtx.client.spaces.searchSpaceContent(
1085-
spaceId,
1086-
{ query },
1087-
{
1088-
...noCacheFetchOptions,
1089-
signal: options.signal,
1090-
},
1091-
);
1092-
return cacheResponse(response);
1093-
},
1094-
});
1095-
1096-
/**
1097-
* Search content accross all spaces in a parent (site or collection).
1098-
*/
1099-
export const searchParentContent = cache({
1100-
name: 'api.searchParentContent',
1101-
tag: (spaceId) => getAPICacheTag({ tag: 'space', space: spaceId }),
1102-
getKeySuffix: getAPIContextId,
1103-
get: async (parentId: string, query: string, options: CacheFunctionOptions) => {
1104-
const apiCtx = await api();
1105-
const response = await apiCtx.client.search.searchContent(
1106-
{ query },
1107-
{
1108-
...noCacheFetchOptions,
1109-
signal: options.signal,
1110-
},
1111-
);
1112-
return cacheResponse(response, {
1113-
ttl: 60 * 60,
1114-
});
1115-
},
1116-
});
1117-
11181069
/**
11191070
* Search content in a Site or specific SiteSpaces.
11201071
*/

0 commit comments

Comments
 (0)