Skip to content

Commit 8e62db2

Browse files
sumitb1606sumitb1606
authored andcommitted
working functionality
1 parent b858088 commit 8e62db2

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

public/assignment/views/user/controllers/login.controller.client.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
function login(userId, password) {
2323
var promise = UserService.findUserByCredentials(userId, password);
2424
promise.success(function(user) {
25-
if(user)
26-
{
25+
if(user)
2726
$location.url("/user/"+user._id);
28-
}
29-
else {
30-
vm.error = "User Not found";
31-
}
27+
else
28+
vm.error = "User Not found";
29+
})
30+
promise.error(function (user) {
31+
vm.error = "User Not found";
3232
})
3333
}
3434

public/assignment/views/user/controllers/profile.controller.client.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232
function init() {
3333
var promise = UserService.findUserById(userId);
3434
promise.success(function(user) {
35-
if(user)
36-
{
3735
vm.user = user;
3836
vm.userId = userId ;
39-
}
40-
else {
41-
vm.error = "User Not found";
42-
}
37+
38+
})
39+
promise.error(function (user) {
40+
vm.error = "User Not found";
4341
})
4442
}
4543
init();

public/assignment/views/user/controllers/register.controller.client.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
userId = user._id;
2222
$location.url('/user/' + userId);
2323
}
24-
2524
)
25+
promise.error(function (user) {
26+
console.log(404);
27+
})
28+
2629
}
2730

2831
}

public/assignment/views/widget/controllers/widget-edit.controller.client.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
.error(function (widget) {
1919
console.log("error");
2020
})
21-
22-
2321
}
2422
init();
2523
vm.userId = $routeParams.uid;

0 commit comments

Comments
 (0)