X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2FTechnique.js;h=1a8f4fc91f0fe92d3bb874816340eab8d4be9ef6;hb=cb6e69664f917891230a511608ceb568a5c176a0;hp=410f01595657de34f339d8c0f88b529bbdab316c;hpb=0586e04204885088f31ac9861446eb0759cc8d2f;p=alttp.git diff --git a/resources/js/helpers/Technique.js b/resources/js/helpers/Technique.js index 410f015..1a8f4fc 100644 --- a/resources/js/helpers/Technique.js +++ b/resources/js/helpers/Technique.js @@ -1,5 +1,15 @@ import i18n from '../i18n'; +export const getLink = tech => { + if (tech.type === 'mode') { + return `/modes/${tech.name}`; + } + if (tech.type === 'ruleset') { + return `/rulesets/${tech.name}`; + } + return `/tech/${tech.name}`; +}; + export const getRelations = (tech, type) => { const rs = (tech && tech.relations) || []; return type ? rs.filter(r => r && r.pivot && r.pivot.type === type) : rs;