Split repo methods into tenant and non-tenant versions

This commit is contained in:
Jon Staab
2026-03-26 12:53:21 -07:00
parent 1b3fe346f5
commit 619fd0c2ce
5 changed files with 112 additions and 87 deletions
+12 -2
View File
@@ -454,7 +454,12 @@ async fn list_relays(
Some(auth.as_str())
};
match state.api.repo.list_relays(tenant_filter).await {
let relays = match tenant_filter {
Some(tenant) => state.api.repo.list_relays_for_tenant(tenant).await,
None => state.api.repo.list_relays().await,
};
match relays {
Ok(relays) => ok(StatusCode::OK, relays),
Err(e) => err(
StatusCode::INTERNAL_SERVER_ERROR,
@@ -747,7 +752,12 @@ async fn list_invoices(
Some(auth.as_str())
};
match state.api.repo.list_invoices(tenant_filter).await {
let invoices = match tenant_filter {
Some(tenant) => state.api.repo.list_invoices_for_tenant(tenant).await,
None => state.api.repo.list_invoices().await,
};
match invoices {
Ok(invoices) => ok(StatusCode::OK, invoices),
Err(e) => err(
StatusCode::INTERNAL_SERVER_ERROR,