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 53dc61e commit 458b989
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 @@ -6,4 +6,6 @@ interface ManagementRepository {
suspend fun postManager(userId: String): Result<Unit>

suspend fun getManagementCode(code: String): Result<Boolean>

suspend fun deleteManager(userId: String): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ class ManagementRepositoryImpl @Inject constructor(

override suspend fun getManagementCode(code: String): Result<Boolean> =
managementDataSource.getManagementCode(code)

override suspend fun deleteManager(userId: String): Result<Unit> =
managementDataSource.deleteManager(userId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ interface ManagementDataSource {
suspend fun postManager(userId: String): Result<Unit>

suspend fun getManagementCode(code: String): Result<Boolean>

suspend fun deleteManager(userId: String): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ class ManagementDataSourceImpl @Inject constructor(

result.isEmpty.not()
}

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

0 comments on commit 458b989

Please sign in to comment.