feat: tag filtering functionality for test cases (#324)

This commit is contained in:
Eliezer Castro
2025-11-08 10:30:50 -03:00
committed by GitHub
parent 0575c928e8
commit 12b5a1babe
10 changed files with 150 additions and 25 deletions

View File

@@ -26,7 +26,14 @@ async function fetchCase(jwt: string, caseId: number) {
}
}
async function fetchCases(jwt: string, folderId: number, title?: string, priority?: number[], type?: number[]) {
async function fetchCases(
jwt: string,
folderId: number,
title?: string,
priority?: number[],
type?: number[],
tag?: number[]
) {
const queryParams = [`folderId=${folderId}`];
if (title) {
@@ -41,6 +48,10 @@ async function fetchCases(jwt: string, folderId: number, title?: string, priorit
queryParams.push(`type=${type.join(',')}`);
}
if (tag && tag.length > 0) {
queryParams.push(`tag=${tag.join(',')}`);
}
const query = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const url = `${apiServer}/cases${query}`;