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;
|
2020-07-17 13:42:45 +00:00
|
|
|
query.uri = configuration.uri;
|
2019-12-17 18:47:37 +00:00
|
|
|
}
|
|
|
|
return this.store.query(this.getModelName(), query);
|
|
|
|
},
|
|
|
|
});
|