Learn Courses My Dashboard

Module 4 Lesson 15 Challenge - Button for fav not working

Please help. I really don’t any idea what’s going on. I even copied the implementation from the solution because all the sensible logic really didn’t work for me. It’s in the DetailView and the snippet looks like this

 NavigationLink(
                    destination: PageView(model:book)){
                   
                        Image(book.cover!)
                            .resizable()
                            .scaledToFit()
                            .padding(.horizontal, 40)
                    };
                
                Text("Mark for later!")
                    .font(.headline).padding([.top, .leading, .trailing])
                
                Button(action: { viewModel.updateFavourite(forId: book.id) }) {
                    Image(systemName: book.isFavourite ? "star.fill" : "star")
                        .resizable()
                        .frame(width: 28, height: 28)
                }
                .accentColor(.yellow)
                

My codes can be downloaded here →
Archive.zip