Revert to consistent pattern with existing swarm forms

Co-authored-by: Siumauricio <[email protected]>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-04 15:23:29 +00:00
co-authored by Siumauricio
parent 582f493f3f
commit c2894260dc
@@ -101,31 +101,15 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => {
// If no networks, send null to clear the database // If no networks, send null to clear the database
const networksToSend = networksArray.length > 0 ? networksArray : null; const networksToSend = networksArray.length > 0 ? networksArray : null;
const mutationPayload: any = { networkSwarm: networksToSend }; await mutateAsync({
applicationId: id || "",
// Add the appropriate ID based on type postgresId: id || "",
switch (type) { redisId: id || "",
case "application": mysqlId: id || "",
mutationPayload.applicationId = id; mariadbId: id || "",
break; mongoId: id || "",
case "postgres": networkSwarm: networksToSend,
mutationPayload.postgresId = id; });
break;
case "redis":
mutationPayload.redisId = id;
break;
case "mysql":
mutationPayload.mysqlId = id;
break;
case "mariadb":
mutationPayload.mariadbId = id;
break;
case "mongo":
mutationPayload.mongoId = id;
break;
}
await mutateAsync(mutationPayload);
toast.success("Network configuration updated successfully"); toast.success("Network configuration updated successfully");
refetch(); refetch();