Skip to content

Commit 6505873

Browse files
authored
Merge pull request #35 from csreades/api_event_parameter
Added in event parameter filter to API code.
2 parents 8adcb7a + 6022009 commit 6505873

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Implementation/API/amc_api_handler_ui.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,16 @@ void CAPIHandler_UI::handleEventRequest(CJSONWriter& writer, const uint8_t* pBod
478478
if (apiRequest.hasValue(AMC_API_KEY_UI_FORMVALUEJSON)) {
479479
sFormValueJSON = apiRequest.getJSONObjectString(AMC_API_KEY_UI_FORMVALUEJSON, LIBMC_ERROR_INVALIDFORMVALUES);
480480
}
481+
482+
std::string sEventParameterJSON;
483+
if (apiRequest.hasValue(AMC_API_KEY_STATUSPARAMETERGROUP_PARAMETERS))
484+
{
485+
sEventParameterJSON = apiRequest.getJSONObjectString(AMC_API_KEY_STATUSPARAMETERGROUP_PARAMETERS, LIBMC_ERROR_INVALIDFORMVALUES);
486+
}
481487

482488
auto pUIHandler = m_pSystemState->uiHandler();
483489

484-
auto pEventResult = pUIHandler->handleEvent(sEventName, sSenderUUID, sFormValueJSON, "", pAuth);
490+
auto pEventResult = pUIHandler->handleEvent(sEventName, sSenderUUID, sFormValueJSON, sEventParameterJSON, pAuth);
485491

486492
CJSONWriterArray contentUpdateNode(writer);
487493

0 commit comments

Comments
 (0)