fix(server): Error when loading album with deleted owner (#4086)

* soft delete albums when user gets soft deleted

* fix wrong intl openapi version

* fix tests

* ability to restore albums, automatically restore when user restored

* (e2e) tests for shared albums via link and with user

* (e2e) test deletion of users and linked albums

* (e2e) fix share album with owner test

* fix: deletedAt

* chore: fix restore order

* fix: use timezone date column

* chore: cleanup e2e tests

* (e2e) fix user delete test

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Daniel Dietzler
2023-09-18 17:56:50 +02:00
committed by GitHub
parent 7d07aaeba3
commit f1c98ac9e6
12 changed files with 149 additions and 21 deletions

View File

@@ -91,6 +91,7 @@ export class UserService {
if (!user) {
throw new BadRequestException('User not found');
}
await this.albumRepository.softDeleteAll(userId);
const deletedUser = await this.userCore.deleteUser(authUser, user);
return mapUser(deletedUser);
}
@@ -101,6 +102,7 @@ export class UserService {
throw new BadRequestException('User not found');
}
const updatedUser = await this.userCore.restoreUser(authUser, user);
await this.albumRepository.restoreAll(userId);
return mapUser(updatedUser);
}