Skip to content

Commit

Permalink
Merge pull request #4 from jmurphyau/build-url-fix
Browse files Browse the repository at this point in the history
Fixes issue with URLs that already end in a '/' character
  • Loading branch information
mike-north committed Jul 7, 2015
2 parents 777678a + b04a511 commit 17c0d97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/utils/build-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ export default function buildOperationUrl(record, opPath, requestType, intance=t
let adapter = record.store.adapterFor(modelName);
let path = opPath;
let baseUrl = adapter.buildURL(modelName, intance ? record.get('id') : null, requestType);
return `${baseUrl}/${path}`;

if (baseUrl.charAt(baseUrl.length-1) === '/') {
return `${baseUrl}${path}`;
} else {
return `${baseUrl}/${path}`;
}
}

0 comments on commit 17c0d97

Please sign in to comment.