Fix(server) Microservice didn't trigger to remove user (#1090)

This commit is contained in:
Alex 2022-12-10 18:01:29 -06:00 committed by GitHub
parent 651f56370a
commit 2876c7ff97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -26,9 +26,9 @@ export class UserDeletionProcessor {
// just for extra protection here
if (userUtils.isReadyForDeletion(user)) {
const basePath = APP_UPLOAD_LOCATION;
const userAssetDir = join(basePath, user.id)
fs.rmSync(userAssetDir, { recursive: true, force: true })
await this.assetRepository.delete({ userId: user.id })
const userAssetDir = join(basePath, user.id);
fs.rmSync(userAssetDir, { recursive: true, force: true });
await this.assetRepository.delete({ userId: user.id });
await this.userRepository.remove(user);
}
}