Skip to content

Commit

Permalink
[Feat] Health-Food-Me#156 - 리뷰 작성 뷰 식당 ID 데이터 전달
Browse files Browse the repository at this point in the history
  • Loading branch information
L-j-h-c committed Jul 20, 2022
1 parent c209204 commit 2ef7564
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

protocol ModuleFactoryProtocol {

Expand All @@ -27,7 +28,7 @@ protocol ModuleFactoryProtocol {
func makeCopingTabVC() -> CopingTabVC
func makeReviewDetailVC() -> ReviewDetailVC
func makeReviewWriteVC() -> ReviewWriteVC
func makeReviewWriteNavigationController() -> ReviewWriteNavigationController
func makeReviewWriteNavigationController(restaurantId: String) -> UINavigationController

// MARK: - Search
func makeSearchVC() -> SearchVC
Expand Down Expand Up @@ -151,8 +152,10 @@ class ModuleFactory: ModuleFactoryProtocol {
return vc
}

func makeReviewWriteNavigationController() -> ReviewWriteNavigationController {
let nc = ReviewWriteNavigationController.controllerFromStoryboard(.reviewWrite)
func makeReviewWriteNavigationController(restaurantId: String) -> UINavigationController {
let vc = ReviewWriteVC.controllerFromStoryboard(.reviewWrite)
vc.restaurantID = restaurantId
guard let nc = UINavigationController(rootViewController: vc) as? UINavigationController else { return UINavigationController() }

return nc
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import Foundation

struct UserEntity: Codable {
let _id, name: String
let scrapRestaurants: [ScrapListEntity]
let scrapRestaurants: [String]
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ extension MainDetailVC {

private func setButtonAction() {
reviewWriteCTAButton.press {
let writeVC = ModuleFactory.resolve().makeReviewWriteNavigationController()
let writeVC = ModuleFactory.resolve().makeReviewWriteNavigationController(restaurantId: self.restaurantId)
writeVC.modalPresentationStyle = .fullScreen
self.present(writeVC, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ extension ReviewWriteVC {
dump(networkResult)
switch networkResult {
case .success(let data):
dump(data)
if let data = data as? ReviewWriteEntity {
print(data, "성공")
}
Expand Down

0 comments on commit 2ef7564

Please sign in to comment.