fix: deduplicate service list in PatchTestsManagement to prevent each_key_duplicate

This commit is contained in:
2026-05-29 18:10:40 +01:00
parent eda4b6d865
commit 0750c7ac0e
@@ -53,7 +53,12 @@ import { Button } from '$lib/components/ui/button';
if (ptRes.ok && svcRes.ok) { if (ptRes.ok && svcRes.ok) {
patchTests = await ptRes.json(); patchTests = await ptRes.json();
availableServices = await svcRes.json(); const svcData = await svcRes.json();
const uniqueSvc = new Map();
svcData.forEach((s: Service) => {
if (s.id) uniqueSvc.set(s.id, s);
});
availableServices = Array.from(uniqueSvc.values());
} else { } else {
toast.error('Failed to load patch test data'); toast.error('Failed to load patch test data');
} }