Skip to content

Commit cc510d3

Browse files
committed
PR updates.
1 parent 05863ab commit cc510d3

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/Umbraco.Forms.Integrations.Automation.Zapier/Components/NewFormSubmittedComponent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ private void RecordStorage_RecordInserting(object sender, Core.RecordEventArgs e
6060
var umbracoPageId = e.Record.UmbracoPageId;
6161
var pageUrl = umbracoContext.UrlProvider.GetUrl(umbracoPageId, UrlMode.Absolute);
6262

63-
if (_zapierFormSubscriptionHookService.TryGetById(e.Form.Id.ToString(), out var zapHookUrls))
63+
if (_zapierFormSubscriptionHookService.TryGetById(e.Form.Id.ToString(), out var subscriptionHooks))
6464
{
6565
var content = e.Form.ToFormDictionary(e.Record, pageUrl);
6666

67-
foreach (var hookUrl in zapHookUrls)
67+
foreach (var subscriptionHook in subscriptionHooks)
6868
{
69-
var result = triggerHelper.FormExecute(hookUrl, content);
69+
var result = triggerHelper.FormExecute(subscriptionHook, content);
7070

7171
if (!string.IsNullOrEmpty(result))
7272
_logger.Error<NewFormSubmittedComponent>(result);

src/Umbraco.Forms.Integrations.Automation.Zapier/Components/NewFormSubmittedNotification.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void Handle(RecordCreatingNotification notification)
5656
{
5757
var form = _formService.Get(notificationSavedEntity.Form);
5858

59-
if (_zapierFormSubscriptionHookService.TryGetById(form.Id.ToString(), out var zapHookUrls))
59+
if (_zapierFormSubscriptionHookService.TryGetById(form.Id.ToString(), out var subscriptionHooks))
6060
{
6161
string pageUrl = string.Empty;
6262
if (_umbracoHelperAccessor.TryGetUmbracoHelper(out UmbracoHelper umbracoHelper))
@@ -70,10 +70,10 @@ public void Handle(RecordCreatingNotification notification)
7070

7171
var content = form.ToFormDictionary(notificationSavedEntity, pageUrl);
7272

73-
foreach (var hookUrl in zapHookUrls)
73+
foreach (var subscriptionHook in subscriptionHooks)
7474
{
7575
var result =
76-
triggerHelper.FormExecute(hookUrl, content);
76+
triggerHelper.FormExecute(subscriptionHook, content);
7777

7878
if(!string.IsNullOrEmpty(result))
7979
_logger.LogError(result);

src/Umbraco.Forms.Integrations.Automation.Zapier/Services/ZapierFormSubscriptionHookService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Linq;
3+
using Umbraco.Forms.Integrations.Automation.Zapier.Models.Dtos;
34

45
#if NETCOREAPP
56
using Microsoft.Extensions.Logging;
@@ -42,7 +43,7 @@ public bool TryGetById(string id, out IEnumerable<string> dto)
4243
{
4344
var entities =
4445
scope.Database
45-
.Query<string>( "SELECT HookUrl FROM zapierSubscriptionHook where EntityId = @0 and Type = 2", id).ToArray();
46+
.Query<string>( "SELECT HookUrl FROM zapierSubscriptionHook where EntityId=@0", id).ToArray();
4647

4748
dto = entities;
4849

0 commit comments

Comments
 (0)