Co-authored-by: Andy Butland <abutland73@gmail.com> Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
27 lines
1022 B
C#
27 lines
1022 B
C#
using Microsoft.Extensions.Options;
|
|
using Umbraco.Cms.Core.Configuration.Models;
|
|
using Umbraco.Cms.Core.Models;
|
|
using Umbraco.Cms.Core.Notifications;
|
|
using Umbraco.Cms.Core.Services;
|
|
using Umbraco.Cms.Core.Sync;
|
|
|
|
namespace Umbraco.Cms.Core.Webhooks.Events;
|
|
|
|
[WebhookEvent("Relation Deleted")]
|
|
public class RelationDeletedWebhookEvent : WebhookEventBase<RelationDeletedNotification>
|
|
{
|
|
public RelationDeletedWebhookEvent(
|
|
IWebhookFiringService webhookFiringService,
|
|
IWebhookService webHookService,
|
|
IOptionsMonitor<WebhookSettings> webhookSettings,
|
|
IServerRoleAccessor serverRoleAccessor)
|
|
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor)
|
|
{
|
|
}
|
|
|
|
public override string Alias => Constants.WebhookEvents.Aliases.RelationDeleted;
|
|
|
|
public override object? ConvertNotificationToRequestPayload(RelationDeletedNotification notification)
|
|
=> notification.DeletedEntities.Select(entity => new DefaultPayloadModel { Id = entity.Key });
|
|
}
|