Subversion Repositories SmartDukaan

Rev

Rev 3701 | Rev 11890 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3701 Rev 4086
Line 26... Line 26...
26
    public String index() throws Exception {
26
    public String index() throws Exception {
27
    	UserClient userServiceClient = new UserClient();
27
    	UserClient userServiceClient = new UserClient();
28
        in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
28
        in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
29
        user = userClient.getUserById(userId);
29
        user = userClient.getUserById(userId);
30
        userAddresses = user.getAddresses();
30
        userAddresses = user.getAddresses();
-
 
31
 
-
 
32
        //
-
 
33
        // For cases where Default Address is NULL in db, we get 0 as long here
-
 
34
        // Skipping such cases to avoid exception. Ideally UserContextService should simply
-
 
35
        // return null in such cases.
-
 
36
        //
-
 
37
        if (user.getDefaultAddressId() != 0) {
31
        primaryAdddress = userClient.getAddressById(user.getDefaultAddressId());
38
            primaryAdddress = userClient.getAddressById(user.getDefaultAddressId());
-
 
39
        }
-
 
40
 
32
        return INDEX;
41
        return INDEX;
33
    }
42
    }
34
 
43
 
35
    public String update() throws Exception {
44
    public String update() throws Exception {
36
        userId = Long.parseLong(id);
45
        userId = Long.parseLong(id);