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

                    destination: PageView(model:book)){
                            .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")
                        .frame(width: 28, height: 28)

My codes can be downloaded here →