powr-sdk-web 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/users/admin.js +16 -26
- package/package.json +1 -1
package/dist/users/admin.js
CHANGED
|
@@ -42,59 +42,49 @@ var PowrBaseUsersAdmin = function PowrBaseUsersAdmin(_ref) {
|
|
|
42
42
|
}, [projectId]);
|
|
43
43
|
var fetchUsers = /*#__PURE__*/function () {
|
|
44
44
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
45
|
-
var
|
|
45
|
+
var response, data, _t;
|
|
46
46
|
return _regenerator().w(function (_context) {
|
|
47
47
|
while (1) switch (_context.n) {
|
|
48
48
|
case 0:
|
|
49
49
|
_context.p = 0;
|
|
50
50
|
setLoading(true);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_context.n = 1;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
setError('No authentication token found');
|
|
57
|
-
setLoading(false);
|
|
58
|
-
return _context.a(2);
|
|
59
|
-
case 1:
|
|
60
|
-
_context.n = 2;
|
|
61
|
-
return fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL || 'https://api.powrbase.cloud', "/profiles?projectId=").concat(projectId), {
|
|
51
|
+
_context.n = 1;
|
|
52
|
+
return fetch("https://api.powrbase.cloud/profiles?projectId=".concat(projectId), {
|
|
62
53
|
headers: {
|
|
63
|
-
'Authorization': "Bearer ".concat(token),
|
|
64
54
|
'Content-Type': 'application/json'
|
|
65
55
|
}
|
|
66
56
|
});
|
|
67
|
-
case
|
|
57
|
+
case 1:
|
|
68
58
|
response = _context.v;
|
|
69
59
|
if (response.ok) {
|
|
70
|
-
_context.n =
|
|
60
|
+
_context.n = 2;
|
|
71
61
|
break;
|
|
72
62
|
}
|
|
73
63
|
throw new Error('Failed to fetch users');
|
|
74
|
-
case
|
|
75
|
-
_context.n =
|
|
64
|
+
case 2:
|
|
65
|
+
_context.n = 3;
|
|
76
66
|
return response.json();
|
|
77
|
-
case
|
|
67
|
+
case 3:
|
|
78
68
|
data = _context.v;
|
|
79
69
|
if (data.success) {
|
|
80
70
|
setUsers(data.users || []);
|
|
81
71
|
} else {
|
|
82
72
|
setError(data.message || 'Failed to fetch users');
|
|
83
73
|
}
|
|
84
|
-
_context.n =
|
|
74
|
+
_context.n = 5;
|
|
85
75
|
break;
|
|
86
|
-
case
|
|
87
|
-
_context.p =
|
|
76
|
+
case 4:
|
|
77
|
+
_context.p = 4;
|
|
88
78
|
_t = _context.v;
|
|
89
79
|
setError(_t.message);
|
|
90
|
-
case
|
|
91
|
-
_context.p =
|
|
80
|
+
case 5:
|
|
81
|
+
_context.p = 5;
|
|
92
82
|
setLoading(false);
|
|
93
|
-
return _context.f(
|
|
94
|
-
case
|
|
83
|
+
return _context.f(5);
|
|
84
|
+
case 6:
|
|
95
85
|
return _context.a(2);
|
|
96
86
|
}
|
|
97
|
-
}, _callee, null, [[0, 5, 6
|
|
87
|
+
}, _callee, null, [[0, 4, 5, 6]]);
|
|
98
88
|
}));
|
|
99
89
|
return function fetchUsers() {
|
|
100
90
|
return _ref2.apply(this, arguments);
|