From c6410855dfa12698978fd2af087af8d76ea9eea1 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 7 Oct 2015 18:21:35 -0600 Subject: [PATCH] results bug fixes --- ReactNative/RealmRPC.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReactNative/RealmRPC.mm b/ReactNative/RealmRPC.mm index ff752187..2345944b 100644 --- a/ReactNative/RealmRPC.mm +++ b/ReactNative/RealmRPC.mm @@ -109,7 +109,7 @@ static RPCObjectID s_id_counter = 0; return ""; }; s_requests["/get_objects"] = [=](NSDictionary *dict) { - RPCObjectID newOid = s_id_counter++; + RPCObjectID resultsId = s_id_counter++; RPCObjectID realmId = [dict[@"realmId"] longValue]; JSValueRef arguments[2]; @@ -124,9 +124,9 @@ static RPCObjectID s_id_counter = 0; JSValueRef exception = NULL; JSValueRef results = RealmObjects(s_context, NULL, s_objects[realmId], argumentCount, arguments, &exception); JSValueProtect(s_context, results); - s_objects[newOid] = (JSObjectRef)results; + s_objects[resultsId] = (JSObjectRef)results; size_t size = RJSGetInternal((JSObjectRef)results)->size(); - return "{\"resultsId\":" + std::to_string(realmId) + ", \"size\":" + std::to_string(size) + "}"; + return "{\"result\":{\"resultsId\":" + std::to_string(resultsId) + ", \"size\":" + std::to_string(size) + "}}"; }; s_requests["/get_results_size"] = [=](NSDictionary *dict) { RPCObjectID resultsId = [dict[@"resultsId"] longValue];