mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Sites & Network Finally Statement
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user