chore(web): generate API functions with a single argument (#2568)

This commit is contained in:
Sergey Kondrikov 2023-05-28 04:52:22 +03:00 committed by GitHub
parent a460940430
commit 6c6c5ef651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 1913 additions and 491 deletions

View file

@ -31,10 +31,12 @@
const lastName = form.get('lastName');
const { status } = await api.authenticationApi.adminSignUp({
email: String(email),
password: String(password),
firstName: String(firstName),
lastName: String(lastName)
signUpDto: {
email: String(email),
password: String(password),
firstName: String(firstName),
lastName: String(lastName)
}
});
if (status === 201) {

View file

@ -29,9 +29,11 @@
error = '';
const { status } = await api.userApi.updateUser({
id: user.id,
password: String(password),
shouldChangePassword: false
updateUserDto: {
id: user.id,
password: String(password),
shouldChangePassword: false
}
});
if (status === 200) {

View file

@ -46,10 +46,12 @@
try {
const { status } = await api.userApi.createUser({
email: String(email),
password: String(password),
firstName: String(firstName),
lastName: String(lastName)
createUserDto: {
email: String(email),
password: String(password),
firstName: String(firstName),
lastName: String(lastName)
}
});
if (status === 201) {

View file

@ -21,11 +21,13 @@
try {
const { id, email, firstName, lastName, storageLabel } = user;
const { status } = await api.userApi.updateUser({
id,
email,
firstName,
lastName,
storageLabel: storageLabel || ''
updateUserDto: {
id,
email,
firstName,
lastName,
storageLabel: storageLabel || ''
}
});
if (status === 200) {
@ -42,9 +44,11 @@
const defaultPassword = 'password';
const { status } = await api.userApi.updateUser({
id: user.id,
password: defaultPassword,
shouldChangePassword: true
updateUserDto: {
id: user.id,
password: defaultPassword,
shouldChangePassword: true
}
});
if (status == 200) {

View file

@ -57,8 +57,10 @@
loading = true;
const { data } = await api.authenticationApi.login({
email,
password
loginCredentialDto: {
email,
password
}
});
if (!data.isAdmin && data.shouldChangePassword) {