Skip to content

Commit

Permalink
include deleted objects in issue validation check
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Dunskus committed Jun 23, 2024
1 parent 0d35161 commit 9bceaa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Issue Manager/Back End/Concrete Requests/Sync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ extension SyncContext {
}

private func pullChangedIssues(for site: ConstructionSite) async throws {
let knownMaps = repository.ids(for: site.maps)
let knownCraftsmen = repository.ids(for: site.craftsmen)
let knownMaps = repository.ids(for: site.allMaps)
let knownCraftsmen = repository.ids(for: site.allCraftsmen)
let knownManagers = repository.ids(for: ConstructionManager.all())

func validate(_ issue: Issue) throws {
Expand Down
8 changes: 6 additions & 2 deletions Issue Manager/Back End/Objects/ConstructionSite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ extension ConstructionSite: Identifiable {
extension ConstructionSite: DBRecord {
static let craftsmen = hasMany(Craftsman.self)
var craftsmen: Craftsman.Query {
request(for: Self.craftsmen).withoutDeleted
allCraftsmen.withoutDeleted
}
/// includes deleted craftsmen
var allCraftsmen: Craftsman.Query { request(for: Self.craftsmen) }

static let maps = hasMany(Map.self)
var maps: Map.Query {
request(for: Self.maps).withoutDeleted
allMaps.withoutDeleted
}
/// includes deleted maps
var allMaps: Map.Query { request(for: Self.maps) }

static let issues = hasMany(Issue.self)
var issues: Issue.Query {
Expand Down

0 comments on commit 9bceaa2

Please sign in to comment.