Skip to content

Commit

Permalink
[CHORE] #93 : 설문 (Survey) Entity 수정 / + SurveyFormId
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 8, 2024
1 parent 3c9b0c1 commit 407dcdd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class PostSurveyUseCase @Inject constructor(
private val surveyRepository: SurveyRepository,
) {
suspend operator fun invoke(
surveyFormId: String,
eventId: String,
title: String,
content: String,
Expand All @@ -19,6 +20,7 @@ class PostSurveyUseCase @Inject constructor(
val userId = userRepository.getUserId().getOrThrow()

surveyRepository.postSurvey(
surveyFormId = surveyFormId,
userId = userId,
eventId = eventId,
title = title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal fun SurveyScreen(
}

is SurveyViewModel.SurveyUiEvent.NotSubmitted -> {
navigateToSurveyAnswer(it.eventId)
navigateToSurveyAnswer(it.surveyFormId)
}
}
}
Expand Down Expand Up @@ -132,10 +132,12 @@ private fun SurveyContent(
.padding(horizontal = 16.dp),
) {
items(surveyFormList) { surveyForm ->
SurveyFormItemCard(
surveyForm = surveyForm,
selectedSurveyForm = selectedSurveyForm,
)
if (surveyForm.isAfterDeadline()) {
SurveyFormItemCard(
surveyForm = surveyForm,
selectedSurveyForm = selectedSurveyForm,
)
}
}
}
}
Expand All @@ -151,7 +153,7 @@ private fun SurveyFormItemCard(
),
modifier = Modifier
.fillMaxWidth()
.clickable { selectedSurveyForm(surveyForm.eventId) },
.clickable { selectedSurveyForm(surveyForm.surveyFormId) },
) {
Column(
verticalArrangement = Arrangement.spacedBy(16.dp),
Expand Down

0 comments on commit 407dcdd

Please sign in to comment.