This commit is contained in:
Trey t
2023-06-19 20:03:41 -05:00
parent c1dc7a2351
commit 55f0926a08
6 changed files with 87 additions and 48 deletions

View File

@@ -41,7 +41,16 @@ struct AllWorkoutsView: View {
Text("no workouts")
}
}.onAppear{
testParse()
AllWorkoutFetchable().fetch(completion: { result in
switch result {
case .success(let model):
DispatchQueue.main.async {
self.workouts = model
}
case .failure(let failure):
fatalError("shit broke")
}
})
}
.sheet(isPresented: $showWorkoutDetail) {
if let selectedWorkout = selectedWorkout {
@@ -52,7 +61,7 @@ struct AllWorkoutsView: View {
}
func selectedItem(workout: Workout) {
selectedWorkout = PreviewWorkout.workout()
selectedWorkout = workout
}
func testParse() {