Initial coomit for AAI-UI(sparky-fe)
[aai/sparky-fe.git] / src / utils / Routes.js
diff --git a/src/utils/Routes.js b/src/utils/Routes.js
new file mode 100644 (file)
index 0000000..a404dea
--- /dev/null
@@ -0,0 +1,15 @@
+
+export function changeUrlAddress(pathObj, historyObj) {
+  let toGo = '/' +
+    pathObj.route +
+    '/' +
+    pathObj.hashId;
+  historyObj.push(toGo, {lastRoute: pathObj.route});
+}
+
+export function buildRouteObj(routePath, routeHash) {
+  return {
+    route: routePath,
+    hashId: routeHash
+  };
+}