diff --git a/.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate b/.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate index dfe3551..0d906b9 100644 Binary files a/.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate and b/.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sources/App/Controllers/FuelEntryV2Controller.swift b/Sources/App/Controllers/FuelEntryV2Controller.swift index dbcb155..432a6ac 100644 --- a/Sources/App/Controllers/FuelEntryV2Controller.swift +++ b/Sources/App/Controllers/FuelEntryV2Controller.swift @@ -648,8 +648,19 @@ struct FuelEntryV2Controller: RouteCollection { if(data == nil || length == 0){ entry.image = nil } + if(entry.id != nil){ + let dbentry = try await FuelEntry.find(entry.id!, on: req.db) + if(dbentry != nil){ + entry._$idExists = true + } + + } + entry.save(on: req.db).whenFailure({ error in + + }) } - try await fuelEntry.create(on: req.db) + +// try await fuelEntry.create(on: req.db) return fuelEntry }