Skip to content

Commit

Permalink
applied linter
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroOliveira42 committed Mar 2, 2025
1 parent 2dc4cb3 commit cc22742
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AccountService(
val fileName = fileUploader.buildFileName(it, dto.email)
account.photo = fileUploader.uploadImage("profile", fileName, it.bytes)
previousPhoto?.let { fileUploader.deleteImage(it) }
//This seems like it should be inside a try catch, but no db changes are, ask in next meet
// This seems like it should be inside a try catch, but no db changes are, ask in next meet
}

val newAccount = dto.update(account)
Expand All @@ -74,10 +74,9 @@ class AccountService(
}

fun deleteAccountById(id: Long) {
val account = getAccountById(id)
?: throw NoSuchElementException(ErrorMessages.accountNotFound(id))
val account = getAccountById(id)

account.photo?.takeIf {it.isNotBlank() }?.let { photo ->
account.photo?.takeIf { it.isNotBlank() }?.let { photo ->
fileUploader.deleteImage(photo)
}
repository.deleteById(id)
Expand Down

0 comments on commit cc22742

Please sign in to comment.