mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-05 13:07:53 +00:00
Fixing list handlers
This commit is contained in:
@@ -9,23 +9,16 @@
|
||||
|
||||
namespace OpenWifi{
|
||||
void RESTAPI_map_list_handler::DoGet() {
|
||||
const char *BlockName{"list"};
|
||||
if(GetBoolParameter("myMaps",false)) {
|
||||
auto where = DB_.OP("creator",ORM::EQ,UserInfo_.userinfo.id);
|
||||
std::vector<ProvObjects::Map> Maps;
|
||||
MapDB::RecordVec Maps;
|
||||
DB_.GetRecords(QB_.Offset,QB_.Limit,Maps,where);
|
||||
return MakeJSONObjectArray("list", Maps, *this);
|
||||
return MakeJSONObjectArray(BlockName, Maps, *this);
|
||||
} else if(GetBoolParameter("sharedWithMe",false)) {
|
||||
|
||||
} else if(!QB_.Select.empty()) {
|
||||
return ReturnRecordList<decltype(DB_),ProvObjects::Map>("list",DB_,*this );
|
||||
} else if(QB_.CountOnly) {
|
||||
Poco::JSON::Object Answer;
|
||||
auto C = DB_.Count();
|
||||
return ReturnCountOnly(C);
|
||||
} else {
|
||||
MapDB::RecordVec Maps;
|
||||
DB_.GetRecords(QB_.Offset,QB_.Limit,Maps);
|
||||
return MakeJSONObjectArray("list", Maps, *this);
|
||||
return ListHandler<MapDB>(BlockName, DB_, *this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user