mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
refactor: rename /api/preview-whitelist to /api/preview/whitelist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,13 +36,13 @@ public class PreviewWhitelistFunction
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET /api/preview-whitelist
|
||||
/// GET /api/preview/whitelist
|
||||
/// Returns all approved tenants.
|
||||
/// </summary>
|
||||
[Function("GetPreviewWhitelist")]
|
||||
[Authorize]
|
||||
public async Task<HttpResponseData> 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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST /api/preview-whitelist/{tenantId}
|
||||
/// POST /api/preview/whitelist/{tenantId}
|
||||
/// Approves a tenant for Private Preview.
|
||||
/// </summary>
|
||||
[Function("ApprovePreviewTenant")]
|
||||
[Authorize]
|
||||
public async Task<HttpResponseData> 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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DELETE /api/preview-whitelist/{tenantId}
|
||||
/// DELETE /api/preview/whitelist/{tenantId}
|
||||
/// Revokes a tenant's Private Preview access.
|
||||
/// </summary>
|
||||
[Function("RevokePreviewTenant")]
|
||||
[Authorize]
|
||||
public async Task<HttpResponseData> 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)
|
||||
{
|
||||
|
||||
+1
-1
@@ -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}` }
|
||||
});
|
||||
|
||||
@@ -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}` }
|
||||
})
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user