UNPKG

overseer-js-sdk

Version:
38 lines (36 loc) 1.13 kB
(function () { this.Organizations = function () {} Organizations.prototype = Object.create(Collection.prototype); Organizations.prototype.constructor = Organizations; Organizations.prototype.model = function (attributes) { return new Organization(attributes); } }()); (function () { this.Organization = function (attributes) { this.attributes = {}; this.oldAttributes = {}; this.fillable = { id: 'integer', name: 'string', slug: 'string', created_at: 'date', updated_at: 'date', }; this.relations = { 'contacts': function(data) { return (new Contacts()).setResponse({ data: data }); }, 'addresses': function(data) { return (new Addresses()).setResponse({ data: data }); } }; this.fill(attributes); } Organization.prototype = Object.create(Model.prototype); Organization.prototype.constructor = Organization; }());