feat(#24): Remove user deletion

This commit is contained in:
2026-02-07 17:25:44 +01:00
parent 52b2bd4cfb
commit 9542d704e4
4 changed files with 1 additions and 32 deletions

View File

@@ -524,22 +524,6 @@ paths:
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
delete:
summary: Delete a user
operationId: deleteUser
tags:
- user
responses:
"204":
description: User successfully deleted
"400":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/BadRequest"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
/users/{id}/email-preferences:
parameters:

View File

@@ -16,11 +16,6 @@ class UserController(
return ResponseEntity.ok(userMapper.toUserDto(user))
}
override fun deleteUser(id: String): ResponseEntity<Unit> {
userService.deleteUser(id)
return ResponseEntity.noContent().build()
}
override fun updateUserEmailPreferences(
id: String,
updateEmailPreferencesDto: UpdateEmailPreferencesDto,

View File

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service
@Service
class UserService(
private val userRepository: UserRepository,
private val userMapper: UserMapper,
) {
fun getCurrentUser(): User {
val principal = SecurityContextHolder.getContext().authentication.principal as CustomJwtTokenPrincipal
@@ -67,10 +66,6 @@ class UserService(
return userRepository.save(user)
}
fun deleteUser(userId: String) {
userRepository.deleteById(userId)
}
@Transactional
fun updateEmailPreferences(
userId: String,

View File

@@ -23,13 +23,8 @@ export function useUserApi() {
return userApiClient.updateUserEmailPreferences({ id, updateEmailPreferencesDto })
}
async function deleteUser(id: string): Promise<void> {
return userApiClient.deleteUser({ id })
}
return {
getUserById,
updateEmailPreferences,
deleteUser
updateEmailPreferences
}
}