mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-09 15:16:00 +01:00
fix(strike): delete current strike webhooks
This commit is contained in:
@@ -20,4 +20,5 @@ tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
thiserror.workspace = true
|
||||
uuid.workspace = true
|
||||
strike-rs = "0.1.0"
|
||||
# strike-rs = "0.1.0"
|
||||
strike-rs = { git = "https://github.com/thesimplekid/strike-rs" }
|
||||
|
||||
@@ -221,6 +221,14 @@ impl Strike {
|
||||
webhook_endpoint: &str,
|
||||
sender: tokio::sync::mpsc::Sender<String>,
|
||||
) -> anyhow::Result<Router> {
|
||||
let subs = self.strike_api.get_current_subscriptions().await?;
|
||||
|
||||
tracing::debug!("Got {} current subscriptions", subs.len());
|
||||
|
||||
for sub in subs {
|
||||
self.strike_api.delete_subscription(sub.id).await?;
|
||||
}
|
||||
|
||||
self.strike_api
|
||||
.create_invoice_webhook_router(webhook_endpoint, sender)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user