File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ package porcelain
2+
3+ import (
4+ "github.com/netlify/open-api/go/models"
5+ "github.com/netlify/open-api/go/plumbing/operations"
6+ "github.com/netlify/open-api/go/porcelain/context"
7+ )
8+
9+ // ListForms lists the forms a user has access to.
10+ func (n * Netlify ) ListForms (ctx context.Context , params * operations.ListFormsParams ) ([]* models.Form , error ) {
11+ resp , err := n .Netlify .Operations .ListForms (params , context .GetAuthInfo (ctx ))
12+ if err != nil {
13+ return nil , err
14+ }
15+
16+ return resp .Payload , nil
17+ }
18+
19+ // ListFormSubmissions lists the forms submissions of a particular form
20+ func (n * Netlify ) ListFormSubmissions (ctx context.Context , formID string ) ([]* models.Submission , error ) {
21+ authInfo := context .GetAuthInfo (ctx )
22+ resp , err := n .Netlify .Operations .ListFormSubmissions (operations .NewListFormSubmissionsParams ().WithFormID (formID ), authInfo )
23+ if err != nil {
24+ return nil , err
25+ }
26+
27+ return resp .Payload , nil
28+ }
You can’t perform that action at this time.
0 commit comments