added delete and update functions to ipnetwork

This commit is contained in:
2024-07-25 12:42:09 +02:00
parent 500486ba38
commit 3c82c1e1b0
3 changed files with 123 additions and 3 deletions
@@ -180,5 +180,39 @@ class IpNetworkController extends mfBaseController {
}
}
private function update(): array {
$json = json_decode(file_get_contents('php://input'), true);
try {
IpNetworkModel::updateIpNetwork($json);
return [
"status" => "success",
"message" => "IP Network updated."
];
} catch (Exception $e) {
return [
"status" => "error",
"message" => $e->getMessage()
];
}
}
private function delete(): array {
$json = json_decode(file_get_contents('php://input'), true);
try {
IpNetworkModel::deleteIpNetwork($json['id']);
return [
"status" => "success",
"message" => "IP Network deleted."
];
} catch (Exception $e) {
return [
"status" => "error",
"message" => $e->getMessage()
];
}
}
}