roboto-js 1.1.5 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/index.js CHANGED
@@ -71,8 +71,14 @@ export default class Roboto{
71
71
  }
72
72
 
73
73
  async registerUser(params){
74
+
75
+ // TODO - need to
76
+
74
77
  return this.api.registerUser(params);
75
78
  }
79
+ async loadUser(params){
80
+ return this.api.loadUser(params);
81
+ }
76
82
  async loadCurrentUser(){
77
83
  return this.api.loadCurrentUser();
78
84
  }
package/src/rbt_api.js CHANGED
@@ -117,18 +117,32 @@ export default class RbtApi {
117
117
  User.setData(userData);
118
118
  return User;
119
119
 
120
- //const record = response.data;
121
- //
122
- //if(dataHash){
123
- // record.data = dataHash;
124
- //}
125
- //return new RbtObject(record, this.axios);
126
120
  } catch (e) {
127
121
  return this._handleError(e);
128
122
  }
129
123
 
130
124
  }
131
125
 
126
+ async loadUser(userId){
127
+
128
+ let params = { id: userId };
129
+
130
+ try {
131
+
132
+ const response = await this.axios.post('/user_service/loadUser', [params]);
133
+ let userData = response?.data?.user;
134
+
135
+ let User = new RbtUser({ id: userData.id }, this.axios);
136
+ User.setData(userData);
137
+ return User;
138
+
139
+ } catch (e) {
140
+ return this._handleError(e);
141
+ }
142
+
143
+ }
144
+
145
+
132
146
  async refreshAuthToken(authtoken){
133
147
 
134
148
  try {