Skip to content

Search not returns Instances. Returns Json Objects #385

@joseglego

Description

@joseglego

I was working with this lib. And following the example in the documentation. I'm doing:

Bike.$search({ brand: 'Trek' })

The return is ok, a list with all possible bikes with the brand. But, what happen now If I wanna modify each element of the list and update it?. The return is just a list of Json Objects. But I think it must return a List of instances of Bikes instances.

  • If I try with Bike.$build() it will do a new instance, and then Bike.$save().
  • But if I try with Bike.$find() for each instance of the list is not elegant and efficient.

I think the $save() can evaluate if the Instance have an Id and do an UPDATE or if have not id do a POST. Or the list must be a list of Bikes instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions