Skip to content

Commit

Permalink
[FEATURE] #141 : WapMemberCode StateFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 27, 2024
1 parent 0f0ba0b commit 671c1a0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.wap.wapp.feature.auth.signup

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wap.wapp.core.domain.usecase.auth.ValidateWapMemberCodeUseCase
import com.wap.wapp.core.domain.usecase.user.PostUserProfileUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
Expand All @@ -16,6 +17,7 @@ import javax.inject.Inject
@HiltViewModel
class SignUpViewModel @Inject constructor(
private val postUserProfileUseCase: PostUserProfileUseCase,
private val validateWapMemberCodeUseCase: ValidateWapMemberCodeUseCase,
) : ViewModel() {

private val _signUpEventFlow = MutableSharedFlow<SignUpEvent>()
Expand All @@ -33,6 +35,9 @@ class SignUpViewModel @Inject constructor(
private val _signUpSemester: MutableStateFlow<String> = MutableStateFlow(FIRST_SEMESTER)
val signUpSemester: StateFlow<String> = _signUpSemester.asStateFlow()

private val _wapMemberCode: MutableStateFlow<String> = MutableStateFlow("")
val wapMemberCode: StateFlow<String> = _wapMemberCode.asStateFlow()

fun validationUserInformation() = viewModelScope.launch {
if (!isValidStudentId()) {
_signUpEventFlow.emit(
Expand Down

0 comments on commit 671c1a0

Please sign in to comment.