PageSourceSearch

https://app.exabler.com/app/services/uidmaps.service.js

js exabler.com collected 2026-09-24 10:21:33 UTC 2,123 bytes, 67 lines download raw bytes

1app.service("UidMapService", [
2    '$http', 'AuthService',
3    function ($http, AuthService) {
4
5        var self = this;
6        const api_base = "/api/v1";
7
8        self.users = [];
9        self.refreshAsync = function() {
10            return updateRelatedUsers();
11        };
12        
13        self.userByUidSync = function(uid) {
14            
15            if (!uid || uid == 0) return {};
16            
17            if (self.users.length == 0) {
18                updateRelatedUsers();
19            }
20            
21            let users = self.users.filter((user) => {
22                return Number(user.uid) === Number(uid)
23            });
24            if (users.length === 1) {
25                
26                return users[0];
27                
28            } else if (users.length <= 0) {
29                // update the service data for the next time
30                updateRelatedUsers();
31                return [];
32            } else {
33                
34                JL('UidMapService').error("Multiple users found with id = " + uid);
35                return users[0];
36                
37            }
38            
39        };
40        
41        var updateRelatedUsers = async function() {
42            
43            return $http.get(api_base+"/all-related-users")
44            .then((response) => {
45                response.data.forEach((user) => {
46                    self.users[user.uid] = user;
47                });
48                if (!self.users[AuthService.User.uid]) {    // if user is not on contacts list e.g. audit / superadmin
49                    self.users[AuthService.User.uid] = {
50                        name: AuthService.User.name,
51                        orgid: AuthService.User.orgid,
52                        role: AuthService.User.role,
53                        status: "active",
54                        uid: AuthService.User.uid,
55                    };
56                }
57                return self.users;
58            })
59            .catch((e) => {
60                JL('UidMapService').error("Error updating related users map");
61                return [];
62            });
63                
64        };
65        
66    }
67]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.