2
2
using System . Collections . Generic ;
3
3
4
4
using System . Linq ;
5
- using Umbraco . Forms . Core . Data . Storage ;
5
+
6
6
using Umbraco . Forms . Core . Providers . Models ;
7
7
using Umbraco . Forms . Core . Services ;
8
8
using Umbraco . Forms . Integrations . Automation . Zapier . Configuration ;
12
12
using Microsoft . Extensions . Options ;
13
13
14
14
using Umbraco . Cms . Web . Common . Controllers ;
15
- using Umbraco . Cms . Core . Services ;
16
15
#else
17
16
using System . Configuration ;
18
17
18
+ using Umbraco . Forms . Core . Data . Storage ;
19
19
using Umbraco . Web . WebApi ;
20
- using Umbraco . Core . Services ;
21
20
#endif
22
21
23
22
namespace Umbraco . Forms . Integrations . Automation . Zapier . Controllers
@@ -26,20 +25,21 @@ public class PollingController : UmbracoApiController
26
25
{
27
26
private readonly ZapierSettings Options ;
28
27
29
- private readonly IFormService _formService ;
30
-
31
28
private readonly IUserValidationService _userValidationService ;
32
29
33
30
#if NETCOREAPP
31
+ private readonly IFormService _formService ;
32
+
34
33
private readonly IWorkflowService _workflowService ;
35
34
36
- public PollingController ( IOptions < ZapierSettings > options , IFormService formService , IWorkflowService workflowService ,
37
- IRecordReaderService recordReaderService , IUserValidationService userValidationService )
35
+ public PollingController ( IOptions < ZapierSettings > options , IFormService formService , IWorkflowService workflowService , IUserValidationService userValidationService )
38
36
#else
39
37
private readonly IWorkflowServices _workflowServices ;
40
38
41
- public PollingController ( IFormService formService , IWorkflowServices workflowServices ,
42
- IRecordReaderService recordReaderService , IUserValidationService userValidationService )
39
+ private readonly IFormStorage _formStorage ;
40
+
41
+ public PollingController ( IWorkflowServices workflowServices ,
42
+ IFormStorage formStorage , IUserValidationService userValidationService )
43
43
#endif
44
44
{
45
45
#if NETCOREAPP
@@ -50,9 +50,9 @@ public PollingController(IFormService formService, IWorkflowServices workflowSer
50
50
Options = new ZapierSettings ( ConfigurationManager . AppSettings ) ;
51
51
52
52
_workflowServices = workflowServices ;
53
- #endif
54
53
55
- _formService = formService ;
54
+ _formStorage = formStorage ;
55
+ #endif
56
56
57
57
_userValidationService = userValidationService ;
58
58
}
@@ -86,7 +86,11 @@ public List<Dictionary<string, string>> GetFormsData()
86
86
if ( ! isAuthorized ) return null ;
87
87
88
88
// 1. get forms
89
+ #if NETCOREAPP
89
90
var forms = _formService . Get ( ) ;
91
+ #else
92
+ var forms = _formStorage . GetAll ( ) ;
93
+ #endif
90
94
foreach ( var form in forms )
91
95
{
92
96
#if NETCOREAPP
0 commit comments