feat: add remove upstream and remove upstream target handlers

This commit is contained in:
GW_MC
2025-12-30 18:02:46 +08:00
parent f4db47daf2
commit f05544267c
4 changed files with 258 additions and 2 deletions

View File

@@ -208,6 +208,11 @@ impl UpstreamService {
)))?
});
with_conn!(&*self.connection, tx, conn, {
// delete all targets belonging to the upstream
upstream_target::Entity::delete_many()
.filter(upstream_target::Column::UpstreamId.eq(upstream_id))
.exec(*conn)
.await?;
model.delete(*conn).await?;
Ok(())
})