Skip to content

Commit

Permalink
[FEATURE] #86 : 사용자 정보 삭제 로직 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 11, 2024
1 parent 458b989 commit 967a1b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ interface UserRepository {
studentId: String,
registeredAt: String,
): Result<Unit>

suspend fun deleteUserProfile(userId: String): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ class UserRepositoryImpl @Inject constructor(
registeredAt = registeredAt,
),
)

override suspend fun deleteUserProfile(userId: String): Result<Unit> =
userDataSource.deleteUserProfile(userId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ interface UserDataSource {
suspend fun getUserProfile(userId: String): Result<UserProfileResponse>

suspend fun getUserId(): Result<String>

suspend fun deleteUserProfile(userId: String): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ class UserDataSourceImpl @Inject constructor(
checkNotNull(userProfile)
}
}

override suspend fun deleteUserProfile(userId: String): Result<Unit> = runCatching {
firebaseFirestore.collection(USER_COLLECTION)
.document(userId)
.delete()
.await()
}
}

0 comments on commit 967a1b3

Please sign in to comment.