Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
//// TopicCapsuleViewModel.swift// twogetskills//// Created by Efrain Yanez Recanatini on 6/29/22.//import Foundationclass TopicCardViewModel: ObservableObject {@Published var topic = TopicModel()public func fetch(topicUuid: String, userUuid : String){let topicDao = TopicDao.sharedInstanceself.topic = topicDao.selectByUuid(uuid: topicUuid)self.fetchProgress(topicUuid: topicUuid, userUuid: userUuid)}public func fetchProgress(topicUuid: String, userUuid : String){let progressDao = ProgressDao.sharedInstancelet progress = progressDao.selectByTopicUuidAndUserUuid(topicUuid: topicUuid, userUuid: userUuid)if progress.id > 0 {self.topic.progress = progress.progressself.topic.completed = progress.completed}}}