MimirLibrary / mimir

3 stars 2 forks source link

fix deleting materials is not working #621 #624

Closed aliakshilimovich closed 1 year ago

aliakshilimovich commented 1 year ago

Deleting didn't work because of the circular foreign key references: Material.current_status_id -> staus.material_id How I fixed it:

  1. Set current_status_id foreign key to null before deleting
  2. Wrapped the whole operation in transaction and moved the method to the service
  3. Removed useless BadRequestException

Closes #621