Skip to content

Commit b25dca7

Browse files
authored
Fix request (#22)
1 parent 63e2b12 commit b25dca7

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

clients/api/client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,12 @@ func (c *Client) CreateApplicationVersion(applicationID string) (*CreateApplicat
256256

257257
// GetOrganizationApplications retrieves all applications for an organization
258258
func (c *Client) GetOrganizationApplications(organizationID string) (*GetOrganizationApplicationsResponse, error) {
259-
path := fmt.Sprintf("/organizations/applications?organizationId=%s", organizationID)
259+
req := GetOrganizationApplicationsRequest{
260+
OrganizationID: organizationID,
261+
}
260262

261263
var resp GetOrganizationApplicationsResponse
262-
err := c.doRequest("GET", path, nil, &resp)
264+
err := c.doRequest("POST", "/organizations/applications", req, &resp)
263265
if err != nil {
264266
return nil, err
265267
}

clients/api/structs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ type ApplicationItem struct {
117117
GithubRepositoryName string `json:"githubRepositoryName"`
118118
}
119119

120-
// GetOrganizationApplicationsResponse represents the response from GET /organizations/applications
120+
// GetOrganizationApplicationsRequest represents the request body for POST /organizations/applications
121+
type GetOrganizationApplicationsRequest struct {
122+
OrganizationID string `json:"organizationId"`
123+
}
124+
125+
// GetOrganizationApplicationsResponse represents the response from POST /organizations/applications
121126
type GetOrganizationApplicationsResponse struct {
122127
Applications []ApplicationItem `json:"applications"`
123128
}

0 commit comments

Comments
 (0)