오디션, 오디션 캐릭터

- 모집완료이면 터치되지 않도록 수정
This commit is contained in:
Yu Sung
2025-01-08 00:25:52 +09:00
parent dd6c2fe469
commit 92608b5449
5 changed files with 78 additions and 26 deletions

View File

@@ -24,11 +24,9 @@ final class AuditionRoleDetailViewModel: ObservableObject {
@Published var name = "보이스온"
@Published var auditionRoleDetail: GetAuditionRoleDetailResponse? = nil
@Published var sortType = AuditionApplicantSortType.NEWEST {
@Published private (set) var sortType = AuditionApplicantSortType.NEWEST {
didSet {
page = 1
isLast = false
getAuditionRoleDetail()
refreshApplicantList()
}
}
@@ -57,6 +55,12 @@ final class AuditionRoleDetailViewModel: ObservableObject {
var onFailure: () -> Void = {}
func setSortType(sortType: AuditionApplicantSortType) {
if self.sortType != sortType {
self.sortType = sortType
}
}
func getAuditionRoleDetail() {
isLoading = true
@@ -237,13 +241,8 @@ final class AuditionRoleDetailViewModel: ObservableObject {
self.phoneNumber = ""
self.fileName = ""
self.soundData = nil
self.applicantList = []
self.totalCount = 0
self.page = 1
self.isLast = false
self.getAuditionRoleDetail()
self.refreshApplicantList()
onSuccess()
} else {
if let message = decoded.message {
@@ -323,6 +322,14 @@ final class AuditionRoleDetailViewModel: ObservableObject {
.store(in: &subscription)
}
private func refreshApplicantList() {
self.page = 1
self.isLast = false
self.totalCount = 0
self.applicantList = []
self.getAuditionApplicantList()
}
func deleteAllRecordingFilesWithNamePrefix(_ prefix: String) {
let fileManager = FileManager.default
let documentsURL = getDocumentsDirectory()