cartodb/lib/assets/javascripts/dashboard/data/user-groups-collection.js
2020-06-15 10:58:47 +08:00

24 lines
552 B
JavaScript

const Backbone = require('backbone');
const GroupModel = require('dashboard/data/group-model');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'configModel'
];
module.exports = Backbone.Collection.extend({
model: function (attrs, { collection }) {
return new GroupModel(attrs, {
collection,
configModel: collection._configModel
});
},
initialize: function (models, opts) {
checkAndBuildOpts(opts, REQUIRED_OPTS, this);
this.organization = opts.organization;
}
});