You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-09 23:17:29 +02:00
refactor(server): user endpoints (#9730)
* refactor(server): user endpoints * fix repos * fix unit tests --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -138,11 +138,9 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
|
||||
Future<bool> changePassword(String newPassword) async {
|
||||
try {
|
||||
await _apiService.userApi.updateUser(
|
||||
UpdateUserDto(
|
||||
id: state.userId,
|
||||
await _apiService.userApi.updateMyUser(
|
||||
UserUpdateMeDto(
|
||||
password: newPassword,
|
||||
shouldChangePassword: false,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -178,9 +176,9 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
user = offlineUser;
|
||||
retResult = false;
|
||||
} else {
|
||||
UserResponseDto? userResponseDto;
|
||||
UserAdminResponseDto? userResponseDto;
|
||||
try {
|
||||
userResponseDto = await _apiService.userApi.getMyUserInfo();
|
||||
userResponseDto = await _apiService.userApi.getMyUser();
|
||||
} on ApiException catch (error, stackTrace) {
|
||||
_log.severe(
|
||||
"Error getting user information from the server [API EXCEPTION]",
|
||||
|
@@ -20,7 +20,7 @@ class CurrentUserProvider extends StateNotifier<User?> {
|
||||
|
||||
refresh() async {
|
||||
try {
|
||||
final user = await _apiService.userApi.getMyUserInfo();
|
||||
final user = await _apiService.userApi.getMyUser();
|
||||
if (user != null) {
|
||||
Store.put(
|
||||
StoreKey.currentUser,
|
||||
|
Reference in New Issue
Block a user