Update API routing, OpenAPI docs, and mailing grid columns

- Add API prefix route convention and custom OpenAPI transformer in Program.cs
- Change "Active" column header to "Sent" in mailing grids
- Improve schedule date sorting logic in ScheduledMailings.tsx
This commit is contained in:
David Headrick 2026-01-30 18:35:03 -06:00
parent 9f6b1ae74c
commit 6a11c1fe86
4 changed files with 12 additions and 5 deletions

View File

@ -13,6 +13,7 @@ using System.Security.Claims;
using System.Text;
using Surge365.Core.Interfaces;
using Surge365.MassEmailReact.Infrastructure.EntityMaps;
using Surge365.Core.OpenApi;
var builder = WebApplication.CreateBuilder(args);
@ -55,10 +56,16 @@ try
});
// Add services to the container.
builder.Services.AddControllers().AddApplicationPart(typeof(Surge365.Core.Controllers.AuthenticationController).Assembly);
builder.Services.AddControllers(options =>
{
options.UseApiPrefixRouteConvention();
}).AddApplicationPart(typeof(Surge365.Core.Controllers.AuthenticationController).Assembly);
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
builder.Services.AddOpenApi(options =>
{
options.AddDocumentTransformer<ExcludeApiPrefixTransformer>();
});
builder.Services.AddScoped<ITargetService, TargetService>();
builder.Services.AddScoped<ITargetRepository, TargetRepository>();
builder.Services.AddScoped<IServerService, ServerService>();

View File

@ -23,7 +23,7 @@ function ActiveMailings() {
{ field: "mailingId", headerName: "Mailing ID", width: 100 },
{ field: "mailingName", headerName: "Name", flex: 1, minWidth: 160 },
{ field: "emailCount", headerName: "Emails", width: 100 },
{ field: "sendCount", headerName: "Active", width: 100 },
{ field: "sendCount", headerName: "Sent", width: 100 },
{ field: "deliveredCount", headerName: "Delivered", width: 100 },
{ field: "failedCount", headerName: "Failed", width: 100 },
{ field: "blockedCount", headerName: "Blocked", width: 100 },

View File

@ -62,7 +62,7 @@ function CompletedMailings() {
return new Date(v1).getTime() - new Date(v2).getTime();
}},
{ field: "emailCount", headerName: "Emails", width: 70 },
{ field: "sendCount", headerName: "Active", width: 70 },
{ field: "sendCount", headerName: "Sent", width: 70 },
{ field: "deliveredCount", headerName: "Delivered", width: 90 },
{ field: "failedCount", headerName: "Failed", width: 70 },
{ field: "blockedCount", headerName: "Blocked", width: 80 },

View File

@ -69,7 +69,7 @@ function ScheduleMailings() {
flex: 1,
minWidth: 200,
valueGetter: (_: any, row: Mailing) => row.scheduleDate ? new Date(row.scheduleDate).toLocaleString() : 'N/A',
sortComparator: (v1: any, v2: any, cellParams1: any, cellParams2: any) => {
sortComparator: (_v1: any, _v2: any, cellParams1: any, cellParams2: any) => {
const date1 = cellParams1.api.getRow(cellParams1.id)?.scheduleDate;
const date2 = cellParams2.api.getRow(cellParams2.id)?.scheduleDate;