Fix IAM create
This commit is contained in:
parent
174acabf43
commit
7aa011ebca
1 changed files with 13 additions and 9 deletions
|
@ -64,18 +64,22 @@ export class IAManager {
|
||||||
/**
|
/**
|
||||||
* Asynchronously creates a new user in the IA API.
|
* Asynchronously creates a new user in the IA API.
|
||||||
*
|
*
|
||||||
* @param {string} username - The username of the user.
|
* @param {string?} username - The username of the user.
|
||||||
* @param {string} password - The password of the user.
|
* @param {string} password - The password of the user.
|
||||||
* @param {Identifier} identifier - The identifier of the user.
|
* @param {Identifier} identifier - The identifier of the user. <type>:<value>
|
||||||
* @return {string} The ID of the newly created user.
|
* @return {string} The ID of the newly created user.
|
||||||
*/
|
*/
|
||||||
async create(username: string, password: string, identifier: Identifier) {
|
async create(password: string, identifier: Identifier, username?: string) {
|
||||||
let req = await axios.post(`${this.URL}/IA}`,
|
let psw: any = {
|
||||||
{
|
|
||||||
username,
|
|
||||||
password,
|
password,
|
||||||
identifier
|
identifier,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (username) psw.username = username
|
||||||
|
|
||||||
|
let req = await axios.put(`${this.URL}/inav`,
|
||||||
|
psw
|
||||||
|
);
|
||||||
return req.data.id;
|
return req.data.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue