2019-12-17 18:47:37 +00:00
|
|
|
import RepositoryService from 'consul-ui/services/repository';
|
2020-02-21 16:48:54 +00:00
|
|
|
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/nspace';
|
2019-12-17 18:47:37 +00:00
|
|
|
|
|
|
|
const modelName = 'nspace';
|
|
|
|
export default RepositoryService.extend({
|
2020-02-21 16:48:54 +00:00
|
|
|
getPrimaryKey: function() {
|
|
|
|
return PRIMARY_KEY;
|
|
|
|
},
|
|
|
|
getSlugKey: function() {
|
|
|
|
return SLUG_KEY;
|
|
|
|
},
|
2019-12-17 18:47:37 +00:00
|
|
|
getModelName: function() {
|
|
|
|
return modelName;
|
|
|
|
},
|
|
|
|
findAll: function(configuration = {}) {
|
|
|
|
const query = {};
|
|
|
|
if (typeof configuration.cursor !== 'undefined') {
|
|
|
|
query.index = configuration.cursor;
|
|
|
|
}
|
|
|
|
return this.store.query(this.getModelName(), query);
|
|
|
|
},
|
|
|
|
});
|