Sites & Network Finally Statement

This commit is contained in:
headlesdev
2025-05-20 20:06:32 +02:00
parent 4f182ca21d
commit b4d43bc0dd
5 changed files with 47 additions and 45 deletions

View File

@@ -25,7 +25,6 @@ export default function EditSite({ site, onSiteEdited }: EditSiteProps) {
}, [site])
const handleEditSite = async () => {
try {
const result = editSite({ id: site.id, name, description, networks: site.networks })
if (typeof result === "string") {
@@ -41,11 +40,10 @@ export default function EditSite({ site, onSiteEdited }: EditSiteProps) {
}
} catch (apiError) {
setError(typeof apiError === "string" ? apiError : "Failed to edit site")
} finally {
setName("")
setDescription("")
}
} catch (err) {
console.error("Error in handleEditSite:", err)
setError("Failed to edit site")
}
}
return (