If we are indexing or foldering then its going to be folder-like
...therefore add a trailing slash to the API call
This commit is contained in:
parent
c5b2e17f04
commit
946bdd6d6e
|
@ -2,6 +2,7 @@ import Route from '@ember/routing/route';
|
|||
import { inject as service } from '@ember/service';
|
||||
import { hash } from 'rsvp';
|
||||
import { get } from '@ember/object';
|
||||
import isFolder from 'consul-ui/utils/isFolder';
|
||||
import WithKvActions from 'consul-ui/mixins/kv/with-actions';
|
||||
|
||||
export default Route.extend(WithKvActions, {
|
||||
|
@ -13,7 +14,12 @@ export default Route.extend(WithKvActions, {
|
|||
},
|
||||
repo: service('kv'),
|
||||
model: function(params) {
|
||||
const key = params.key || '/';
|
||||
let key = params.key || '/';
|
||||
// we are index or folder, so if the key doesn't have a trailing slash
|
||||
// add one to force a fake findBySlug
|
||||
if (!isFolder(key)) {
|
||||
key = key + '/';
|
||||
}
|
||||
const dc = this.modelFor('dc').dc.Name;
|
||||
const repo = get(this, 'repo');
|
||||
return hash({
|
||||
|
|
Loading…
Reference in New Issue