Skip to content

Commit a587744

Browse files
committed
Added operations code for list_forms_parameter and ListFormsBySiteId
1 parent 941aefb commit a587744

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

go/plumbing/operations/list_forms_parameters.go

Lines changed: 35 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/porcelain/forms.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ func (n *Netlify) ListForms(ctx context.Context, params *operations.ListFormsPar
1616
return resp.Payload, nil
1717
}
1818

19+
// ListFormsBySiteId lists the forms of a particular site
20+
func (n *Netlify) ListFormsBySiteId(ctx context.Context, siteID string) ([]*models.Form, error) {
21+
authInfo := context.GetAuthInfo(ctx)
22+
resp, err := n.Netlify.Operations.ListForms(operations.NewListFormsParams().WithSiteID(siteID))
23+
if err != nil {
24+
return nil, err
25+
}
26+
27+
return resp.Payload, nil
28+
}
29+
1930
// ListFormSubmissions lists the forms submissions of a particular form
2031
func (n *Netlify) ListFormSubmissions(ctx context.Context, formID string) ([]*models.Submission, error) {
2132
authInfo := context.GetAuthInfo(ctx)

ui/swagger.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,13 @@
489489
"/forms": {
490490
"get": {
491491
"operationId": "listForms",
492+
"parameters": [
493+
{
494+
"type": "string",
495+
"name": "site_id",
496+
"in": "query"
497+
}
498+
],
492499
"responses": {
493500
"200": {
494501
"description": "OK",

0 commit comments

Comments
 (0)