mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
2.0.1 Beta
This commit is contained in:
21
src/app/utils/UrlGenerators.js
Normal file
21
src/app/utils/UrlGenerators.js
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
/**
|
||||
* 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 parts = ['/outfit/', shipId];
|
||||
|
||||
if (code) {
|
||||
parts.push('/', code);
|
||||
}
|
||||
|
||||
if (buildName) {
|
||||
parts.push('?bn=', encodeURIComponent(buildName));
|
||||
}
|
||||
return parts.join('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user