-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ SplashView isJoining API 호출 로직 수정, 이슈 #5 수정
- Loading branch information
1 parent
0d51142
commit 5b156fc
Showing
13 changed files
with
92 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// ModalityViewModel.swift | ||
// dogether | ||
// | ||
// Created by seungyooooong on 2/20/25. | ||
// | ||
|
||
import Foundation | ||
|
||
final class ModalityViewModel { | ||
private(set) var reviews: [ReviewModel] = [] | ||
private(set) var current: Int = 0 | ||
private(set) var result: ReviewResults? = nil | ||
private(set) var rejectReason: String = "" | ||
|
||
func setReviews(_ reviews: [ReviewModel]?) { | ||
guard let reviews else { return } | ||
self.reviews = reviews | ||
} | ||
|
||
func setCurrent(_ current: Int) { | ||
self.current = current | ||
} | ||
|
||
func setResult(_ result: ReviewResults? = nil) { | ||
self.result = result | ||
} | ||
|
||
func setRejectReason(_ rejectReason: String = "") { | ||
self.rejectReason = rejectReason | ||
} | ||
|
||
func reviewTodo() async throws { | ||
let todoId = String(reviews[current].id) | ||
guard let result else { return } | ||
let reviewTodoRequest = ReviewTodoRequest(result: result, rejectReason: result == .reject ? rejectReason : nil) | ||
try await NetworkManager.shared.request( | ||
TodoCertificationsRouter.reviewTodo(todoId: todoId, reviewTodoRequest: reviewTodoRequest) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters