added delete and update functions to ipnetwork
This commit is contained in:
@@ -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()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user