WIP 💩(front) hack to use the fulltext search api
Enable OIDC_STORE_ACCESS_TOKEN for new e2e tests.
This commit is contained in:
@@ -6,4 +6,9 @@ Y_PROVIDER_API_BASE_URL=http://y-provider:4444/api/
|
||||
|
||||
# Throttle
|
||||
API_DOCUMENT_THROTTLE_RATE=1000/min
|
||||
API_CONFIG_THROTTLE_RATE=1000/min
|
||||
API_CONFIG_THROTTLE_RATE=1000/min
|
||||
|
||||
# Store OIDC tokens in the session.
|
||||
OIDC_STORE_ACCESS_TOKEN = True
|
||||
OIDC_STORE_REFRESH_TOKEN = True # Store the encrypted refresh token in the session.
|
||||
OIDC_STORE_REFRESH_TOKEN_KEY = "na1hhus-OLhq9mb9SO3R-8E4dONuMnqpZSY_SX8xcFk="
|
||||
|
||||
@@ -44,7 +44,16 @@ export const constructParams = (params: DocsParams): URLSearchParams => {
|
||||
export type DocsResponse = APIList<Doc>;
|
||||
export const getDocs = async (params: DocsParams): Promise<DocsResponse> => {
|
||||
const searchParams = constructParams(params);
|
||||
const response = await fetchAPI(`documents/?${searchParams.toString()}`);
|
||||
let response
|
||||
|
||||
// HACK for fulltext search feature
|
||||
if (searchParams.has('title')) {
|
||||
searchParams.set('q', searchParams.get('title') || '');
|
||||
searchParams.delete('title');
|
||||
response = await fetchAPI(`documents/search?${searchParams.toString()}`);
|
||||
} else {
|
||||
response = await fetchAPI(`documents/?${searchParams.toString()}`);
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new APIError('Failed to get the docs', await errorCauses(response));
|
||||
|
||||
Reference in New Issue
Block a user