Skip to content

Commit

Permalink
Merge pull request #49 from APPSCHOOL3-iOS/feature/#2-RecruitFeedView
Browse files Browse the repository at this point in the history
style: reportCount 변수추가
  • Loading branch information
KaiKimiOS authored Aug 23, 2023
2 parents c520a1d + 6045740 commit 2e231be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct FeedRecruitModel {
var imageURL: [String]
var location: String
var privateSetting: Bool
var reportCount: Int
var createdAt: Double = Date().timeIntervalSince1970

var createdDate: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class FeedRecruitStore: ObservableObject {
let location: String = docData["location"] as? String ?? ""
let privateSetting: Bool = docData["privateSetting"] as? Bool ?? false
let createdAt: Double = docData["createdDate"] as? Double ?? 0.0
let reportCount: Int = docData["reportCount"] as? Int ?? 0

let feeds = FeedRecruitModel(id: id, creator: creator, content: content, imageURL: imageURL, location: location, privateSetting: privateSetting , createdAt: createdAt)
let feeds = FeedRecruitModel(id: id, creator: creator, content: content, imageURL: imageURL, location: location, privateSetting: privateSetting, reportCount: reportCount , createdAt: createdAt)

tempFeeds.append(feeds)
}
Expand All @@ -54,7 +55,8 @@ class FeedRecruitStore: ObservableObject {
"imageURL": feed.imageURL,
"location": feed.location,
"privateSetting": feed.privateSetting,
"createdAt": feed.createdDate])
"createdAt": feed.createdDate,
"reportCount": feed.reportCount])

fetchFeeds()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct FeedRecruitView: View {
}
ToolbarItem(placement:.navigationBarTrailing) {
Button("등록") {
let newFeed = FeedRecruitModel(creator: "", content: contentText, imageURL: [""], location: locationAddress, privateSetting: privacySetting.setting)
let newFeed = FeedRecruitModel(creator: "", content: contentText, imageURL: [""], location: locationAddress, privateSetting: privacySetting.setting, reportCount: 0)

feedStoreViewModel.addFeed(newFeed)

Expand Down

0 comments on commit 2e231be

Please sign in to comment.