[PR #935] [MERGED] feat(server,web): Delete and restore user from the admin portal #8829

Closed
opened 2026-02-05 13:53:59 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/935
Author: @zkhan93
Created: 11/7/2022
Status: Merged
Merged: 11/8/2022
Merged by: @alextran1502

Base: mainHead: feature/delete-user


📝 Commits (5)

  • 0cb4b4e delete and restore user from admin UI
  • f3f20ea addressed review comments and fix e2e test
  • 1824a24 added cron job to delete user, and some formatting changes
  • 06e8963 addressed review comments
  • b0254db adding missing queue registration

📊 Changes

30 files changed (+804 additions, -59 deletions)

View changed files

📝 mobile/openapi/README.md (+2 -0)
📝 mobile/openapi/doc/UserApi.md (+96 -0)
📝 mobile/openapi/doc/UserResponseDto.md (+1 -0)
📝 mobile/openapi/lib/api/user_api.dart (+96 -0)
📝 mobile/openapi/lib/model/user_response_dto.dart (+15 -3)
📝 server/apps/immich/src/api-v1/user/response-dto/user-response.dto.ts (+2 -0)
📝 server/apps/immich/src/api-v1/user/user-repository.ts (+19 -5)
📝 server/apps/immich/src/api-v1/user/user.controller.ts (+15 -0)
📝 server/apps/immich/src/api-v1/user/user.service.spec.ts (+2 -0)
📝 server/apps/immich/src/api-v1/user/user.service.ts (+46 -2)
📝 server/apps/immich/src/modules/background-task/background-task.processor.ts (+2 -32)
📝 server/apps/immich/src/modules/schedule-tasks/schedule-tasks.module.ts (+10 -1)
📝 server/apps/immich/src/modules/schedule-tasks/schedule-tasks.service.ts (+20 -0)
📝 server/apps/immich/test/user.e2e-spec.ts (+2 -0)
server/apps/microservices/src/processors/user-deletion.processor.ts (+35 -0)
📝 server/immich-openapi-specs.json (+1 -1)
server/libs/common/src/utils/asset-utils.ts (+39 -0)
📝 server/libs/common/src/utils/index.ts (+2 -0)
server/libs/common/src/utils/user-utils.spec.ts (+19 -0)
server/libs/common/src/utils/user-utils.ts (+16 -0)

...and 10 more files

📄 Description

implementation as discussed in #695

UI and API changes for soft deleting a user

  • added a column in userEntity deletedAt
  • added endpoints to delete and restore user

with this PR deleting a user will disable the users login and set a timestamp on user which can be used by the job to do the actual deleting

added user delete job to run at 11 PM (before all the other jobs to reduce the work other jobs might have to do, when a user is deleted)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/935 **Author:** [@zkhan93](https://github.com/zkhan93) **Created:** 11/7/2022 **Status:** ✅ Merged **Merged:** 11/8/2022 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `feature/delete-user` --- ### 📝 Commits (5) - [`0cb4b4e`](https://github.com/immich-app/immich/commit/0cb4b4e8095ff5a08f698ab200bbd774a3b09e5d) delete and restore user from admin UI - [`f3f20ea`](https://github.com/immich-app/immich/commit/f3f20eaa066baa5b237d4e56d18e68c43d38ef62) addressed review comments and fix e2e test - [`1824a24`](https://github.com/immich-app/immich/commit/1824a244b5013e07d0319e1e14cc13ada3216773) added cron job to delete user, and some formatting changes - [`06e8963`](https://github.com/immich-app/immich/commit/06e89635ad39fc7896012a8436aef96e87e0ec46) addressed review comments - [`b0254db`](https://github.com/immich-app/immich/commit/b0254db291fdaa8ca32205463a4c591e0a4f405b) adding missing queue registration ### 📊 Changes **30 files changed** (+804 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `mobile/openapi/README.md` (+2 -0) 📝 `mobile/openapi/doc/UserApi.md` (+96 -0) 📝 `mobile/openapi/doc/UserResponseDto.md` (+1 -0) 📝 `mobile/openapi/lib/api/user_api.dart` (+96 -0) 📝 `mobile/openapi/lib/model/user_response_dto.dart` (+15 -3) 📝 `server/apps/immich/src/api-v1/user/response-dto/user-response.dto.ts` (+2 -0) 📝 `server/apps/immich/src/api-v1/user/user-repository.ts` (+19 -5) 📝 `server/apps/immich/src/api-v1/user/user.controller.ts` (+15 -0) 📝 `server/apps/immich/src/api-v1/user/user.service.spec.ts` (+2 -0) 📝 `server/apps/immich/src/api-v1/user/user.service.ts` (+46 -2) 📝 `server/apps/immich/src/modules/background-task/background-task.processor.ts` (+2 -32) 📝 `server/apps/immich/src/modules/schedule-tasks/schedule-tasks.module.ts` (+10 -1) 📝 `server/apps/immich/src/modules/schedule-tasks/schedule-tasks.service.ts` (+20 -0) 📝 `server/apps/immich/test/user.e2e-spec.ts` (+2 -0) ➕ `server/apps/microservices/src/processors/user-deletion.processor.ts` (+35 -0) 📝 `server/immich-openapi-specs.json` (+1 -1) ➕ `server/libs/common/src/utils/asset-utils.ts` (+39 -0) 📝 `server/libs/common/src/utils/index.ts` (+2 -0) ➕ `server/libs/common/src/utils/user-utils.spec.ts` (+19 -0) ➕ `server/libs/common/src/utils/user-utils.ts` (+16 -0) _...and 10 more files_ </details> ### 📄 Description implementation as discussed in #695 UI and API changes for soft deleting a user - added a column in userEntity deletedAt - added endpoints to delete and restore user with this PR deleting a user will disable the users login and set a timestamp on user which can be used by the job to do the actual deleting added user delete job to run at 11 PM (before all the other jobs to reduce the work other jobs might have to do, when a user is deleted) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:53:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8829