Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom save routes #10

Open
lucasjans opened this issue Mar 17, 2012 · 1 comment
Open

Custom save routes #10

lucasjans opened this issue Mar 17, 2012 · 1 comment

Comments

@lucasjans
Copy link

Here's a simple request. Would love to have the ability to utilize custom save roues. Why? There's sometimes special business logic we want to perform when saving records.

I can hack this in right now by modifying the es.objects.NAME.prototype.esRoutes['commit'] before saving and then changing it back after saving, but it would be nice if there was an elegant solution to the one you have here for custom load routes

es.objects.RevCoCompaniesCollection.prototype.loadHostCompanies = function (success, error, state) {
    return this.load({
        route: this.esRoutes['LoadHostCompanies'],
        success: success,
        error: error,
        state: state
    });
};
es.objects.RevCoCompaniesCollection.prototype.esRoutes['LoadHostCompanies'] =  { method: 'GET', url: 'RevCoCompaniesCollection_LoadHostCompanies', response: 'collection' }
@lucasjans
Copy link
Author

For what it's worth, I looked at the .save function, but it doesn't accept an argument for the "route."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant