Skip to content

Commit

Permalink
[Fix] #226 - conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongdung-eo committed Mar 12, 2024
1 parent 3ed474c commit 3d756a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
8 changes: 4 additions & 4 deletions iOS-NOTTODO/iOS-NOTTODO/Network/API/Mission/MissionAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typealias DetailMissionData = GeneralResponse<MissionDetailResponseDTO>
typealias AchieveCalendarData = GeneralArrayResponse<AchieveCalendarResponseDTO>
typealias RecentMissionData = GeneralArrayResponse<RecentMissionResponseDTO>
typealias UpdateMissionData = GeneralResponse<UpdateMissionResponseDTO>
typealias AddMissionData = GeneralResponse<AddMissionResponseDTO>
typealias AddMissionsData = GeneralResponse<AddMissionResponseDTO>
typealias AddAnotherDay = GeneralResponse<AddAnotherDayResponseDTO>
typealias UpdateMissionStatus = GeneralResponse<DailyMissionResponseDTO>

Expand All @@ -29,7 +29,7 @@ protocol MissionAPIType {
func deleteMission(id: Int, completion: @escaping (GeneralResponse<VoidType>?) -> Void)
func patchUpdateMissionStatus(id: Int, status: String, completion: @escaping (UpdateMissionStatus?) -> Void)
func postAnotherDay(id: Int, dates: [String], completion: @escaping (AddAnotherDay?) -> Void)
func postAddMission(request: AddMissionRequest, completion: @escaping(AddMissionData?) -> Void)
func postAddMission(request: AddMissionRequest, completion: @escaping(AddMissionsData?) -> Void)
func putUpdateMission(request: UpdateMissionRequest, completion: @escaping(UpdateMissionData?) -> Void)
}

Expand Down Expand Up @@ -201,12 +201,12 @@ final class MissionAPI: MissionAPIType {
}

func postAddMission(request: AddMissionRequest,
completion: @escaping(AddMissionData?) -> Void) {
completion: @escaping(AddMissionsData?) -> Void) {
provider.request(.addMission(request: request)) { result in
switch result {
case .success(let response):
do {
let response = try response.map(AddMissionData?.self)
let response = try response.map(AddMissionsData?.self)
completion(response)
} catch let err {
print(err.localizedDescription, 500)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ extension AchievementViewController {
$0.bottom.equalTo(scrollView.snp.bottom).inset(20)
}
}

func requestMonthAPI(month: String) {
MissionAPI.shared.getAchieveCalendar(month: month) { [weak self] response in

guard let self, let response = response, let data = response.data else { return }

let calendarData = data.compactMap { ($0.actionDate, $0.percentage) }
self.dataSource = Dictionary(uniqueKeysWithValues: calendarData)
self.monthCalendar.calendar.collectionView.reloadData()
}
}
}

extension AchievementViewController: FSCalendarDelegate, FSCalendarDataSource, FSCalendarDelegateAppearance {
Expand Down Expand Up @@ -187,7 +176,7 @@ extension AchievementViewController: FSCalendarDelegate, FSCalendarDataSource, F
extension AchievementViewController {

func requestMonthAPI(month: String) {
AchieveAPI.shared.getAchieveCalendar(month: month) { [weak self] response in
MissionAPI.shared.getAchieveCalendar(month: month) { [weak self] response in

guard let self, let response = response, let data = response.data else { return }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ extension RecommendActionViewController: UICollectionViewDelegate {
extension RecommendActionViewController {

func requestRecommendActionAPI(index: Int) {
RecommendActionAPI.shared.getRecommendAction(index: index) { [weak self] response in
RecommendAPI.shared.getRecommendAction(index: index) { [weak self] response in
guard let self = self,
let response = response,
let data = response.data,
Expand Down

0 comments on commit 3d756a2

Please sign in to comment.