Add username back to device list stats.

This commit is contained in:
Simo Kinnunen
2014-07-02 14:13:11 +09:00
parent d2ea49ef07
commit d51da4b215
5 changed files with 122 additions and 23 deletions

View File

@@ -1,8 +1,14 @@
module.exports = function UserServiceFactory($http, $rootScope, socket, $timeout) {
var userService = {}
userService.user = (function () {
userService.currentUser = (function () {
var userPromise = $http.get('/api/v1/user')
.then(function(response) {
if (!response.data.success) {
throw new Error('Unable to get user data')
}
return response.data.user
})
return function () {
return userPromise
}