Skip to content

Ability to use a single object as parameter in methods and subscriptions #21

@sornii

Description

@sornii

Hi,

We have a guide in meteor that suggests to use a single object as a parameter in method calls and subscriptions. Since that, I built every method or subscription this way:

Meteor.methods({
  'iterations.insert'({ uuid, name }) {
    const _iteration = Iterations.findOne({ uuid });
    if (_iteration) {
      return _iteration._id;
    }
    return Iterations.insert({ uuid, name });
  }
});

It's not possible, because the client.call that's implemented in this project receives a array of objects Object[] and pass it as parameters building a json like this:
params: ["uuid", "name"].

It should be possible as well to pass a single object to client.call but I don't know if its going to build this:
params: [{uuid: "uuid", name: "name"}]
or this
params: {uuid: "uuid", name: "name"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions