Dropping `switch` for ternary format

This commit is contained in:
Andrew Hayward 2013-04-18 17:43:04 +01:00
Родитель c5e8c91653
Коммит 1127c4ab0a
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -36,15 +36,7 @@ function generateToken () {
function extractUserData (user) {
var userType = user.daoFactoryName.toLowerCase(),
userHome;
switch (userType) {
case 'learner':
userHome = '/backpack';
break
default:
userHome = '/dashboard';
}
userHome = (userType == 'learner') ? '/backpack' : '/dashboard';
return {
id: user.id,