fix: NewRemoteReview param struct, atomic review+orphan movie delete
This commit is contained in:
@@ -60,6 +60,15 @@ impl MovieCommand for InMemoryStore {
|
||||
"Database operation failed".into(),
|
||||
));
|
||||
}
|
||||
self.remove_movie_with_cascades(id);
|
||||
self.record_events(events);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl InMemoryStore {
|
||||
/// Removes the movie row and applies the schema's cascades.
|
||||
pub(super) fn remove_movie_with_cascades(&self, id: uuid::Uuid) {
|
||||
self.movies.write().unwrap().remove(&id);
|
||||
self.watchlist
|
||||
.write()
|
||||
@@ -72,9 +81,6 @@ impl MovieCommand for InMemoryStore {
|
||||
*event = detached_from_movie(event);
|
||||
}
|
||||
}
|
||||
drop(events_guard);
|
||||
self.record_events(events);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user