Use query parameters rather than long path

This commit is contained in:
Cmdr McDonald
2016-11-21 10:06:14 +00:00
parent e4830811b0
commit 8857aba53f
7 changed files with 22 additions and 12 deletions

View File

@@ -6,15 +6,18 @@
* @return {String} URL
*/
export function outfitURL(shipId, code, buildName) {
let parts = ['/outfit/', shipId];
let path = '/outfit/' + shipId;
let sepChar = '?';
if (code) {
parts.push('/', code);
path = path + sepChar + 'code=' + encodeURIComponent(code);
sepChar = '&';
}
if (buildName) {
parts.push('?bn=', encodeURIComponent(buildName));
path = path + sepChar + 'bn=' + encodeURIComponent(buildName);
}
return parts.join('');
}
return path;
}