콘텐츠 등록
- 한정판 등록 기능 추가
This commit is contained in:
@@ -55,15 +55,48 @@ final class ContentCreateViewModel: ObservableObject {
|
||||
didSet {
|
||||
if isFree {
|
||||
priceString = "0"
|
||||
isLimited = false
|
||||
isOnlyRental = false
|
||||
isGeneratePreview = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Published var isOnlyRental = false
|
||||
@Published var isOnlyRental = false {
|
||||
didSet {
|
||||
if isOnlyRental {
|
||||
isLimited = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@Published var isGeneratePreview = true
|
||||
|
||||
@Published var isLimited = false {
|
||||
didSet {
|
||||
if !isLimited {
|
||||
limitedString = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Published var limited: Int? = nil {
|
||||
didSet {
|
||||
if let limited = limited, limited <= 0 {
|
||||
limitedString = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Published var limitedString: String = "" {
|
||||
didSet {
|
||||
if limitedString == "" {
|
||||
limited = nil
|
||||
} else {
|
||||
limited = Int(limitedString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Published var previewStartTime: String = ""
|
||||
@Published var previewEndTime: String = ""
|
||||
@Published var releaseDateString: String = Date().convertDateFormat(dateFormat: "yyyy.MM.dd")
|
||||
@@ -92,6 +125,7 @@ final class ContentCreateViewModel: ObservableObject {
|
||||
detail: detail,
|
||||
tags: hashtags,
|
||||
price: price,
|
||||
limited: limited,
|
||||
releaseDate: isActiveReservation ? "\(releaseDate.convertDateFormat(dateFormat: "yyyy-MM-dd")) \(releaseTime.convertDateFormat(dateFormat: "HH:mm"))" : nil,
|
||||
timezone: TimeZone.current.identifier,
|
||||
themeId: theme!.id,
|
||||
|
||||
Reference in New Issue
Block a user