feat: add preprod observability foundation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Socialize.Api.Data;
|
||||
using Socialize.Api.Infrastructure.Observability;
|
||||
using Socialize.Api.Infrastructure.Security;
|
||||
using Socialize.Api.Modules.Organizations.Data;
|
||||
using Socialize.Api.Modules.Organizations.Services;
|
||||
@@ -21,7 +22,8 @@ internal class CreateOrganizationRequestValidator
|
||||
}
|
||||
|
||||
internal class CreateOrganizationHandler(
|
||||
AppDbContext dbContext)
|
||||
AppDbContext dbContext,
|
||||
SocializeMetrics metrics)
|
||||
: Endpoint<CreateOrganizationRequest, OrganizationDto>
|
||||
{
|
||||
public override void Configure()
|
||||
@@ -66,6 +68,7 @@ internal class CreateOrganizationHandler(
|
||||
dbContext.Organizations.Add(organization);
|
||||
dbContext.OrganizationMemberships.Add(ownerMembership);
|
||||
await dbContext.SaveChangesAsync(ct);
|
||||
metrics.RecordOrganizationCreated(organization.Id);
|
||||
|
||||
await SendAsync(
|
||||
OrganizationDto.FromOrganization(
|
||||
|
||||
Reference in New Issue
Block a user