feat: automatic guided routing from Test Case -> Group -> Suite
This commit is contained in:
parent
c1410a126e
commit
d0d60a6fe5
|
|
@ -75,7 +75,7 @@ export default function TestCaseFormView() {
|
|||
const url = isEdit ? `/api/test-cases/${id}` : '/api/test-cases';
|
||||
const method = isEdit ? 'PUT' : 'POST';
|
||||
const r = await api(url, { method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) });
|
||||
if (r.ok) { toast('success', isEdit ? 'Updated!' : 'Created!', `"${name}" with ${steps.length} step(s).`); setTimeout(() => navigate('/test-cases'), 900); }
|
||||
if (r.ok) { toast('success', isEdit ? 'Updated!' : 'Created!', `"${name}" with ${steps.length} step(s).`); setTimeout(() => navigate(isEdit ? '/test-cases' : '/test-case-groups/create'), 900); }
|
||||
else { toast('error', 'Failed'); setSaving(false); }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export default function TestCaseGroupFormView() {
|
|||
const url = isEdit ? `/api/test-case-groups/${id}` : '/api/test-case-groups';
|
||||
const method = isEdit ? 'PUT' : 'POST';
|
||||
const r = await api(url, { method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name, description: desc, testCaseIds: selected }) });
|
||||
if (r.ok) { toast('success', isEdit ? 'Updated!' : 'Created!', `"${name}" with ${selected.length} case(s).`); setTimeout(() => navigate('/test-case-groups'), 900); }
|
||||
if (r.ok) { toast('success', isEdit ? 'Updated!' : 'Created!', `"${name}" with ${selected.length} case(s).`); setTimeout(() => navigate(isEdit ? '/test-case-groups' : '/test-suites/create'), 900); }
|
||||
else { toast('error', 'Failed'); setSaving(false); }
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue