fix: test runs can be managed separately (#321)

This commit is contained in:
Matheus Santana
2025-11-02 10:57:32 -03:00
committed by GitHub
parent 3fd226bdbd
commit 0575c928e8
4 changed files with 61 additions and 33 deletions

View File

@@ -112,7 +112,7 @@ export default function RunEditor({
};
const initTestCases = async () => {
const casesData = await fetchProjectCases(tokenContext.token.access_token, Number(projectId));
const casesData = await fetchProjectCases(tokenContext.token.access_token, Number(projectId), Number(runId));
casesData.forEach((testCase: CaseType) => {
if (testCase.RunCases && testCase.RunCases.length > 0) {
testCase.RunCases[0].editState = 'notChanged';

View File

@@ -315,8 +315,8 @@ async function updateRunCases(jwt: string, runId: number, testCases: CaseType[])
}
}
async function fetchProjectCases(jwt: string, projectId: number) {
const url = `${apiServer}/cases/byproject?projectId=${projectId}`;
async function fetchProjectCases(jwt: string, projectId: number, runId: number) {
const url = `${apiServer}/cases/byproject?projectId=${projectId}&runId=${runId}`;
try {
const response = await fetch(url, {