chore: Include test case title query in filters to improve UI consistency (#284)
This commit is contained in:
@@ -26,9 +26,13 @@ async function fetchCase(jwt: string, caseId: number) {
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchCases(jwt: string, folderId: number, priority?: number[], type?: number[], q?: string) {
|
||||
async function fetchCases(jwt: string, folderId: number, title?: string, priority?: number[], type?: number[]) {
|
||||
const queryParams = [`folderId=${folderId}`];
|
||||
|
||||
if (title) {
|
||||
queryParams.push(`title=${title}`);
|
||||
}
|
||||
|
||||
if (priority && priority.length > 0) {
|
||||
queryParams.push(`priority=${priority.join(',')}`);
|
||||
}
|
||||
@@ -37,10 +41,6 @@ async function fetchCases(jwt: string, folderId: number, priority?: number[], ty
|
||||
queryParams.push(`type=${type.join(',')}`);
|
||||
}
|
||||
|
||||
if (q) {
|
||||
queryParams.push(`q=${q}`);
|
||||
}
|
||||
|
||||
const query = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
||||
|
||||
const url = `${apiServer}/cases${query}`;
|
||||
|
||||
@@ -12,7 +12,7 @@ export function highlightSearchTerm({
|
||||
text,
|
||||
searchTerm,
|
||||
className,
|
||||
minSearchLength = 2,
|
||||
minSearchLength = 1,
|
||||
}: HighlightSearchTermProps): ReactNode {
|
||||
if (!text || !searchTerm || searchTerm.length < minSearchLength) {
|
||||
return text || null;
|
||||
|
||||
Reference in New Issue
Block a user