zeyneplervesarp / swe574-javagang

3 stars 1 forks source link

upsert service method for editing services is problematic #164

Closed ZDenizYStenhaug closed 2 years ago

ZDenizYStenhaug commented 2 years ago

The bug: When editing a service, the upsert method in ServiceService throws an error: org.springframework.web.server.ResponseStatusException: 400 BAD_REQUEST "A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: com.swe573.socialhub.domain.Service.approvalSet; nested exception is org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: com.swe573.socialhub.domain.Service.approvalSet"

Progress: I tried to implement the solution that I found here. Though I'm still getting the same error.

To reproduce:

  1. checkout to the feature branch: FEATURE/53-add-deadline-for-editing-and-application-for-services
  2. Run the application
  3. Log in with miranda.
  4. The service "Eminönü Tour" must be from two days from the day of the initialization of the application. Try to edit that service.

SS: image

OS: Windows 10 Browser: Chrome