From 0e92c90ed520897a59ad1ff81ecf5d9337526418 Mon Sep 17 00:00:00 2001
From: Eugen Ciur <eugen@papermerge.com>
Date: Fri, 22 Oct 2021 21:05:09 +0200
Subject: [PATCH] minor refactorings of the routes

---
 app/controllers/login.js              | 1 +
 app/router.js                         | 3 +--
 app/routes/authenticated/index.js     | 6 ++++--
 app/templates/authenticated/index.hbs | 4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/app/controllers/login.js b/app/controllers/login.js
index 7aa2167..2463c00 100644
--- a/app/controllers/login.js
+++ b/app/controllers/login.js
@@ -27,6 +27,7 @@ export default class LoginController extends Controller {
 
     if (this.session.isAuthenticated) {
       // What to do with all this success?
+      this.transitionToRoute('authenticated.index');
     }
   }
 
diff --git a/app/router.js b/app/router.js
index 61086cd..2914d56 100644
--- a/app/router.js
+++ b/app/router.js
@@ -7,8 +7,6 @@ export default class Router extends EmberRouter {
 }
 
 Router.map(function () {
-  this.route('login');
-
   this.route('authenticated', { path: '' }, function() {
     this.route('documents');
     this.route('inbox');
@@ -42,5 +40,6 @@ Router.map(function () {
     });
   });
 
+  this.route('login');
   this.route('not-found', { path: '/*path' });
 });
diff --git a/app/routes/authenticated/index.js b/app/routes/authenticated/index.js
index 781afc2..0d87799 100644
--- a/app/routes/authenticated/index.js
+++ b/app/routes/authenticated/index.js
@@ -1,10 +1,12 @@
-import Route from '@ember/routing/route';
 import { inject as service } from '@ember/service';
+import BaseRoute from 'papermerge/base/routing';
 
 
-export default class IndexRoute extends Route {
+export default class IndexRoute extends BaseRoute {
+  /*
   @service store;
   async model() {
     return this.store.findAll('node');
   }
+  */
 }
diff --git a/app/templates/authenticated/index.hbs b/app/templates/authenticated/index.hbs
index dc58275..603c3bc 100644
--- a/app/templates/authenticated/index.hbs
+++ b/app/templates/authenticated/index.hbs
@@ -1,2 +1,2 @@
-<Breadcrumb />
-<Nodes @nodes={{@model}} />
\ No newline at end of file
+
+Documents and Folders will be displayed here!
\ No newline at end of file
-- 
GitLab