diff --git a/src/RESTAPI/RESTAPI_board_handler.cpp b/src/RESTAPI/RESTAPI_board_handler.cpp index ee47e44..1bd0381 100644 --- a/src/RESTAPI/RESTAPI_board_handler.cpp +++ b/src/RESTAPI/RESTAPI_board_handler.cpp @@ -84,11 +84,15 @@ namespace OpenWifi { } ProvObjects::UpdateObjectInfo(RawObject,UserInfo_.userinfo,Existing.info); + if(RawObject->has("venueList")) { - // reconsile new venuelist compared to old... + if(NewObject.venueList.empty()) { + return BadRequest("Invalid VenueList."); + } + Existing.venueList = NewObject.venueList; } - if(StorageService()->BoardsDB().CreateRecord(Existing)) { + if(StorageService()->BoardsDB().UpdateRecord("id",Existing.info.id,Existing)) { VenueCoordinator()->ModifyBoard(Existing.info.id); AnalyticsObjects::BoardInfo NewBoard; StorageService()->BoardsDB().GetRecord("id",Existing.info.id,NewBoard); @@ -96,5 +100,6 @@ namespace OpenWifi { NewBoard.to_json(Answer); return ReturnObject(Answer); } + return InternalError("Board could nto be modified. Verify and try again.") } } \ No newline at end of file