From 0d2f2ae38c0deb913f9cc3046d4edf7daddfdfd7 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Sun, 1 Mar 2026 16:50:18 +0100 Subject: [PATCH] refactor: rename /api/preview-whitelist to /api/preview/whitelist Co-Authored-By: Claude Opus 4.6 --- .../Functions/PreviewWhitelistFunction.cs | 12 ++++++------ .../components/TenantManagementSection.tsx | 2 +- .../app/admin-configuration/page.tsx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Backend/AutopilotMonitor.Functions/Functions/PreviewWhitelistFunction.cs b/src/Backend/AutopilotMonitor.Functions/Functions/PreviewWhitelistFunction.cs index cb31ea54..4cf62cf9 100644 --- a/src/Backend/AutopilotMonitor.Functions/Functions/PreviewWhitelistFunction.cs +++ b/src/Backend/AutopilotMonitor.Functions/Functions/PreviewWhitelistFunction.cs @@ -36,13 +36,13 @@ public class PreviewWhitelistFunction } /// - /// GET /api/preview-whitelist + /// GET /api/preview/whitelist /// Returns all approved tenants. /// [Function("GetPreviewWhitelist")] [Authorize] public async Task GetAll( - [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "preview-whitelist")] HttpRequestData req, + [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "preview/whitelist")] HttpRequestData req, FunctionContext context) { var principal = context.GetUser(); @@ -65,13 +65,13 @@ public class PreviewWhitelistFunction } /// - /// POST /api/preview-whitelist/{tenantId} + /// POST /api/preview/whitelist/{tenantId} /// Approves a tenant for Private Preview. /// [Function("ApprovePreviewTenant")] [Authorize] public async Task Approve( - [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "preview-whitelist/{tenantId}")] HttpRequestData req, + [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "preview/whitelist/{tenantId}")] HttpRequestData req, string tenantId, FunctionContext context) { @@ -146,13 +146,13 @@ public class PreviewWhitelistFunction } /// - /// DELETE /api/preview-whitelist/{tenantId} + /// DELETE /api/preview/whitelist/{tenantId} /// Revokes a tenant's Private Preview access. /// [Function("RevokePreviewTenant")] [Authorize] public async Task Revoke( - [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = "preview-whitelist/{tenantId}")] HttpRequestData req, + [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = "preview/whitelist/{tenantId}")] HttpRequestData req, string tenantId, FunctionContext context) { diff --git a/src/Web/autopilot-monitor-web/app/admin-configuration/components/TenantManagementSection.tsx b/src/Web/autopilot-monitor-web/app/admin-configuration/components/TenantManagementSection.tsx index 3f73088b..068ab0a6 100644 --- a/src/Web/autopilot-monitor-web/app/admin-configuration/components/TenantManagementSection.tsx +++ b/src/Web/autopilot-monitor-web/app/admin-configuration/components/TenantManagementSection.tsx @@ -185,7 +185,7 @@ export function TenantManagementSection({ const isCurrentlyApproved = previewApproved.has(tenantId); - const response = await fetch(`${API_BASE_URL}/api/preview-whitelist/${tenantId}`, { + const response = await fetch(`${API_BASE_URL}/api/preview/whitelist/${tenantId}`, { method: isCurrentlyApproved ? "DELETE" : "POST", headers: { 'Authorization': `Bearer ${token}` } }); diff --git a/src/Web/autopilot-monitor-web/app/admin-configuration/page.tsx b/src/Web/autopilot-monitor-web/app/admin-configuration/page.tsx index 0505b6dd..f4459953 100644 --- a/src/Web/autopilot-monitor-web/app/admin-configuration/page.tsx +++ b/src/Web/autopilot-monitor-web/app/admin-configuration/page.tsx @@ -128,7 +128,7 @@ export default function AdminConfigurationPage() { fetch(`${API_BASE_URL}/api/config/all`, { headers: { 'Authorization': `Bearer ${token}` } }), - fetch(`${API_BASE_URL}/api/preview-whitelist`, { + fetch(`${API_BASE_URL}/api/preview/whitelist`, { headers: { 'Authorization': `Bearer ${token}` } }) ]);