From 2b7989c5ebcae141b40d104c8c363068c4f188ce Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Wed, 17 Jan 2024 23:39:40 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20#105=20:=20surveyFormId=20->=20id?= =?UTF-8?q?=EB=A1=9C=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/survey/SurveyDataSourceImpl.kt | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/survey/SurveyDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/survey/SurveyDataSourceImpl.kt index 8cb01873..2dc537c7 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/survey/SurveyDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/survey/SurveyDataSourceImpl.kt @@ -48,25 +48,24 @@ class SurveyDataSourceImpl @Inject constructor( result } - override suspend fun getSurveyListBySurveyFormId( - surveyFormId: String, - ): Result> = runCatching { - val result: MutableList = mutableListOf() + override suspend fun getSurveyListBySurveyFormId(id: String): Result> = + runCatching { + val result: MutableList = 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> = runCatching {