Skip to content

Commit

Permalink
remove double slash from generated api endopints in generated adapter (
Browse files Browse the repository at this point in the history
…#7299)

remove double slash from generated api endopints
  • Loading branch information
madalynrose authored Aug 12, 2019
1 parent c121cbd commit 85b0a94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/app/services/path-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default Service.extend({
//we need the mount config
path = paths.configPath[0].path;
}
helpUrl = `/v1/${apiPath}${path}?help=true`;
helpUrl = `/v1/${apiPath}${path.slice(1)}?help=true`;
return this.registerNewModelWithProps(helpUrl, backend, newModel, modelName);
});
}
Expand Down Expand Up @@ -177,7 +177,7 @@ export default Service.extend({
return generatedItemAdapter.extend({
urlForItem(method, id) {
let { path } = listPath;
let url = `${this.buildURL()}/${apiPath}${path}/`;
let url = `${this.buildURL()}/${apiPath}${path.slice(1)}/`;
if (id) {
url = url + encodePath(id);
}
Expand All @@ -190,20 +190,20 @@ export default Service.extend({

urlForUpdateRecord(id) {
let { path } = createPath;
path = path.slice(0, path.indexOf('{') - 1);
path = path.slice(1, path.indexOf('{') - 1);
return `${this.buildURL()}/${apiPath}${path}/${id}`;
},

urlForCreateRecord(modelType, snapshot) {
const { id } = snapshot;
let { path } = createPath;
path = path.slice(0, path.indexOf('{') - 1);
path = path.slice(1, path.indexOf('{') - 1);
return `${this.buildURL()}/${apiPath}${path}/${id}`;
},

urlForDeleteRecord(id) {
let { path } = deletePath;
path = path.slice(0, path.indexOf('{') - 1);
path = path.slice(1, path.indexOf('{') - 1);
return `${this.buildURL()}/${apiPath}${path}/${id}`;
},
});
Expand Down

0 comments on commit 85b0a94

Please sign in to comment.