Simplify object schema info returned from RPC
Only the property names are needed.
This commit is contained in:
parent
c928ab716e
commit
36ffc6c77c
|
@ -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),
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue