Skip to content

Custom save routes #10

@lucasjans

Description

@lucasjans

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' }

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