attlaz-client 1.9.44 → 1.9.45
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.
|
@@ -20,7 +20,7 @@ export declare class UserEndpoint extends Endpoint {
|
|
|
20
20
|
allowed: boolean;
|
|
21
21
|
}>>;
|
|
22
22
|
update(user: User): Promise<User>;
|
|
23
|
-
create(user: User, invitationCode?: string | null): Promise<User>;
|
|
23
|
+
create(user: User, password: string, invitationCode?: string | null): Promise<User>;
|
|
24
24
|
requestResetPassword(email: string): Promise<boolean>;
|
|
25
25
|
resetPassword(code: string, password: string): Promise<boolean>;
|
|
26
26
|
}
|
|
@@ -90,7 +90,7 @@ class UserEndpoint extends Endpoint_1.Endpoint {
|
|
|
90
90
|
async update(user) {
|
|
91
91
|
try {
|
|
92
92
|
let url = '/users/' + user.id;
|
|
93
|
-
const result = await this.requestObject(url,
|
|
93
|
+
const result = await this.requestObject(url, user, User_1.User.parse, 'POST');
|
|
94
94
|
const updatedUser = result.getData();
|
|
95
95
|
if (updatedUser === null) {
|
|
96
96
|
throw new Error('User not updated');
|
|
@@ -104,14 +104,13 @@ class UserEndpoint extends Endpoint_1.Endpoint {
|
|
|
104
104
|
throw e;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
async create(user, invitationCode = null) {
|
|
107
|
+
async create(user, password, invitationCode = null) {
|
|
108
108
|
try {
|
|
109
109
|
let url = '/users/';
|
|
110
|
-
const data =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const result = await this.requestObject(url, data, parser, 'PUT', false);
|
|
110
|
+
const data = user;
|
|
111
|
+
data.password = password;
|
|
112
|
+
data.invitation_code = invitationCode;
|
|
113
|
+
const result = await this.requestObject(url, data, User_1.User.parse, 'PUT', false);
|
|
115
114
|
const createdUser = result.getData();
|
|
116
115
|
if (createdUser === null) {
|
|
117
116
|
throw new Error('User not created');
|