Skip to content

Commit

Permalink
Backport 1.2.2: remove double slash from generated api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
madalynrose authored Aug 12, 2019
1 parent e16495d commit 9a92268
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 9a92268

Please sign in to comment.