From 9ec86d7ab782babc4d4f4b583920c3c91b68ea3d Mon Sep 17 00:00:00 2001 From: Madalyn <3230904+madalynrose@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:27:37 -0400 Subject: [PATCH] remove double slash from generated api endopints in generated adapter (#7299) remove double slash from generated api endopints --- ui/app/services/path-help.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/app/services/path-help.js b/ui/app/services/path-help.js index 6ac8e80ae7e1..60a8b6883f65 100644 --- a/ui/app/services/path-help.js +++ b/ui/app/services/path-help.js @@ -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); }); } @@ -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); } @@ -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}`; }, });