Simplify object schema info returned from RPC

Only the property names are needed.
This commit is contained in:
Scott Kyle 2015-11-02 21:54:05 -08:00
parent c928ab716e
commit 36ffc6c77c
2 changed files with 4 additions and 8 deletions

View File

@ -24,9 +24,7 @@ function create(realmId, info) {
object[keys.id] = info.id;
object[keys.type] = info.type;
schema.properties.forEach((prop) => {
let name = prop.name;
schema.properties.forEach((name) => {
Object.defineProperty(object, name, {
enumerable: true,
get: util.getterForProperty(name),

View File

@ -289,12 +289,10 @@ json RPCServer::serialize_json_value(JSValueRef value) {
}
json RPCServer::serialize_object_schema(const realm::ObjectSchema &object_schema) {
json properties = json::array();
std::vector<std::string> properties;
for (realm::Property prop : object_schema.properties) {
properties.push_back({
{"name", prop.name},
{"type", RJSTypeGet(prop.type)},
});
properties.push_back(prop.name);
}
return {