mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
chore(web): generate API functions with a single argument (#2568)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -57,8 +57,10 @@
|
||||
loading = true;
|
||||
|
||||
const { data } = await api.authenticationApi.login({
|
||||
email,
|
||||
password
|
||||
loginCredentialDto: {
|
||||
email,
|
||||
password
|
||||
}
|
||||
});
|
||||
|
||||
if (!data.isAdmin && data.shouldChangePassword) {
|
||||
|
||||
Reference in New Issue
Block a user