Skip to content

Commit

Permalink
[CHORE] #105 : surveyFormId -> id로 파라미터 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Jan 17, 2024
1 parent eef2117 commit 2b7989c
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,24 @@ class SurveyDataSourceImpl @Inject constructor(
result
}

override suspend fun getSurveyListBySurveyFormId(
surveyFormId: String,
): Result<List<SurveyResponse>> = runCatching {
val result: MutableList<SurveyResponse> = mutableListOf()
override suspend fun getSurveyListBySurveyFormId(id: String): Result<List<SurveyResponse>> =
runCatching {
val result: MutableList<SurveyResponse> = mutableListOf()

val task = firebaseFirestore.collection(SURVEY_COLLECTION)
.whereEqualTo("surveyFormId", surveyFormId)
.get()
.await()
val task = firebaseFirestore.collection(SURVEY_COLLECTION)
.whereEqualTo("surveyFormId", id)
.get()
.await()

for (document in task.documents) {
val surveyResponse = document.toObject(SurveyResponse::class.java)
checkNotNull(surveyResponse)
for (document in task.documents) {
val surveyResponse = document.toObject(SurveyResponse::class.java)
checkNotNull(surveyResponse)

result.add(surveyResponse)
}
result.add(surveyResponse)
}

result
}
result
}

override suspend fun getUserRespondedSurveyList(userId: String): Result<List<SurveyResponse>> =
runCatching {
Expand Down

0 comments on commit 2b7989c

Please sign in to comment.