mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
24 lines
556 B
JavaScript
24 lines
556 B
JavaScript
/**
|
|
* Generates a URL for the outiffing page
|
|
* @param {String} shipId Ship Id
|
|
* @param {String} code [optional] Serliazed build code
|
|
* @param {String} buildName [optional] Build name
|
|
* @return {String} URL
|
|
*/
|
|
export function outfitURL(shipId, code, buildName) {
|
|
let path = '/outfit/' + shipId;
|
|
|
|
let sepChar = '?';
|
|
|
|
if (code) {
|
|
path = path + sepChar + 'code=' + encodeURIComponent(code);
|
|
sepChar = '&';
|
|
}
|
|
|
|
if (buildName) {
|
|
path = path + sepChar + 'bn=' + encodeURIComponent(buildName);
|
|
}
|
|
|
|
return path;
|
|
}
|