Hello, first of all thanks for this repository.
I found a issue that we discuss in #18, this is the mixin does not work for models with a custom identifier. This PR fixes that, and during the course of my work I tested the whole library and found some other issues that I took the opportunity to correct.
The list of changes:
Feature #18: Support for models with custom a identifier
Feature: Support allTrees with no arguments but callback
Feature: Support asTree with no arguments. It will behave as allTrees
Feature: Do not obligate deleteNode to pass options argument.
Feature: Do not enforce remote args to be object, since nodes can be also located through the id
Bugfix #17: It works now, but we should ask about the specific API query which is supposedly failing
Bugfix: moveNode with callback was not resolving
Bugfix: saveJsonTree must resolve after all nodes got updated
Bugfix: Post and put remotes should not receive args from query string
Bugfix: Getting "Unhandled rejection Error: Callback was already called" through API remotes. This is due to a wrong callback hybridization. Polygoat set up to successfully on every public methods to support both callbacks and promises
Remove the "before save" hook. The parent property now is set through a new relation "parentObject"
Prevention: Use lodash each to prevent iteration over built-in js members
Tests to cover all mixin use cases, with either promises, callbacks or through the API, and for models with either ObjectId or custom identifiers (coverage 90.87%).
NPM scripts to run tests and tests with coverage
Include testing information in README file
Include package-lock.json: it's intended to be checked into source control (guarantee exact same version of every package)
Hello, first of all thanks for this repository. I found a issue that we discuss in #18, this is the mixin does not work for models with a custom identifier. This PR fixes that, and during the course of my work I tested the whole library and found some other issues that I took the opportunity to correct.
The list of changes:
I hope all these changes are ok for you.