feat(#24): Remove user deletion
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user