mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
9f45c29239
commit
5b7f7344df
@ -269,9 +269,15 @@ Dictionary::Ptr ApiActions::AddComment(const ConfigObject::Ptr& object,
|
||||
if (!params->Contains("author") || !params->Contains("comment"))
|
||||
return ApiActions::CreateResult(400, "Comments require author and comment.");
|
||||
|
||||
double timestamp = 0.0;
|
||||
|
||||
if (params->Contains("expiry")) {
|
||||
timestamp = HttpUtility::GetLastParameter(params, "expiry");
|
||||
}
|
||||
|
||||
String commentName = Comment::AddComment(checkable, CommentUser,
|
||||
HttpUtility::GetLastParameter(params, "author"),
|
||||
HttpUtility::GetLastParameter(params, "comment"), false, 0);
|
||||
HttpUtility::GetLastParameter(params, "comment"), false, timestamp);
|
||||
|
||||
Comment::Ptr comment = Comment::GetByName(commentName);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user