Skip to content

Commit

Permalink
Merge pull request TeamNADA#414 from TeamNADA/feature/TeamNADA#413
Browse files Browse the repository at this point in the history
fix: 카드 리스트 뷰에서 조회 및 재정렬할 때 사용하는 데이터모델 자료형 수정 (TeamNADA#413)
  • Loading branch information
hyun99999 authored Apr 14, 2023
2 parents e0c9837 + 07f790d commit 0e33fa9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 35 deletions.
4 changes: 0 additions & 4 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
397B75172763B5B7004AEB03 /* TeamNADA.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 397B75162763B5B7004AEB03 /* TeamNADA.storyboard */; };
397B751A2763B5F1004AEB03 /* TeamNADAViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 397B75192763B5F1004AEB03 /* TeamNADAViewController.swift */; };
3981148E273BEBB300E28630 /* CardReorderInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3981148D273BEBB300E28630 /* CardReorderInfo.swift */; };
39811490273BEBCE00E28630 /* CardListRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3981148F273BEBCE00E28630 /* CardListRequest.swift */; };
398413B7274A7A1E005550BC /* AddGroupBottomSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398413B6274A7A1E005550BC /* AddGroupBottomSheetViewController.swift */; };
399C55DF2711949D00845A54 /* CGPoint+Distance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 399C55DE2711949D00845A54 /* CGPoint+Distance.swift */; };
39C1E88F270EC762006D2089 /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39C1E88E270EC762006D2089 /* UIColor+Extension.swift */; };
Expand Down Expand Up @@ -283,7 +282,6 @@
397B75162763B5B7004AEB03 /* TeamNADA.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TeamNADA.storyboard; sourceTree = "<group>"; };
397B75192763B5F1004AEB03 /* TeamNADAViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamNADAViewController.swift; sourceTree = "<group>"; };
3981148D273BEBB300E28630 /* CardReorderInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardReorderInfo.swift; sourceTree = "<group>"; };
3981148F273BEBCE00E28630 /* CardListRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardListRequest.swift; sourceTree = "<group>"; };
398413B6274A7A1E005550BC /* AddGroupBottomSheetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddGroupBottomSheetViewController.swift; sourceTree = "<group>"; };
399C55DE2711949D00845A54 /* CGPoint+Distance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGPoint+Distance.swift"; sourceTree = "<group>"; };
39C1E88E270EC762006D2089 /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1008,7 +1006,6 @@
F87122752733046300A24E74 /* Card.swift */,
F871227727330A3800A24E74 /* CardCreationRequest.swift */,
3981148D273BEBB300E28630 /* CardReorderInfo.swift */,
3981148F273BEBCE00E28630 /* CardListRequest.swift */,
F8D92E0929D5324E002ACC73 /* Taste.swift */,
);
path = Card;
Expand Down Expand Up @@ -1753,7 +1750,6 @@
F8FC43BA26C022900033E151 /* ViewController.swift in Sources */,
39D13568273FDCB800B1A148 /* UserWithTokenRequest.swift in Sources */,
F84BAFB126FDB552004CA335 /* BackCardCreationCollectionViewCell.swift in Sources */,
39811490273BEBCE00E28630 /* CardListRequest.swift in Sources */,
F8FC43BC26C022A20033E151 /* Storyboard.swift in Sources */,
F8C83FC1272FA06E0009DF0D /* UserAPI.swift in Sources */,
392BAF792793BAF80013DCB3 /* KeyChain.swift in Sources */,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// CardListRequest.swift
// CardListInGroupRequest.swift
// NADA-iOS-forRelease
//
// Created by Yi Joon Choi on 2021/11/12.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class CardAPI {
}
}

func cardDelete(cardID: String, completion: @escaping (NetworkResult<Any>) -> Void) {
func cardDelete(cardID: Int, completion: @escaping (NetworkResult<Any>) -> Void) {
cardProvider.request(.cardDelete(cardID: cardID)) { (result) in
switch result {
case .success(let response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum CardService {
case cardListPageFetch(pageNumber: Int, pageSize: Int)
case cardListFetch
case cardReorder(request: [CardReorderInfo])
case cardDelete(cardID: String)
case cardDelete(cardID: Int)
case imageUpload(image: UIImage)
case tasteFetch(cardType: CardType)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import KakaoSDKCommon
class CardListViewController: UIViewController {

// MARK: - Properties
var cardItems: [CardList] = []
var cardItems: [Card] = []
var newCardItems: [CardReorderInfo] = []

// MARK: - IBOutlet Properties
Expand Down Expand Up @@ -145,7 +145,7 @@ extension CardListViewController: UITableViewDataSource {
} else {
guard let serviceCell = tableView.dequeueReusableCell(withIdentifier: Const.Xib.cardListTableViewCell, for: indexPath) as? CardListTableViewCell else { return UITableViewCell() }

serviceCell.initData(title: cardItems[indexPath.row].title)
serviceCell.initData(title: cardItems[indexPath.row].cardName)
serviceCell.pinButton.addTarget(self, action: #selector(pinButtonClicked(_:)), for: .touchUpInside)

if indexPath.row == 0 {
Expand All @@ -169,8 +169,8 @@ extension CardListViewController {
CardAPI.shared.cardListFetch { response in
switch response {
case .success(let data):
if let card = data as? CardListRequest {
self.cardItems = card.cardDates
if let card = data as? [Card] {
self.cardItems = card
self.cardListTableView.reloadData()
}
case .requestErr(let message):
Expand Down Expand Up @@ -202,7 +202,7 @@ extension CardListViewController {
}
}

func deleteCardWithAPI(cardID: String) {
func deleteCardWithAPI(cardID: Int) {
CardAPI.shared.cardDelete(cardID: cardID) { response in
switch response {
case .success(let data):
Expand Down

0 comments on commit 0e33fa9

Please sign in to comment.