Skip to content

Commit

Permalink
fix: fix install mod sdk is wrong (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Oct 30, 2024
1 parent 4e46734 commit f452937
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 5 deletions.
158 changes: 154 additions & 4 deletions codegen/mod_management/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion pkg/mod_management/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,22 @@ func (c *ModManagementClient) InstallableModules() ([]mod_management.RemoteModul
}

func (c *ModManagementClient) InstallModule(name string) error {
resp, err := c.Client.InstallableModuleListWithResponse(context.Background())
resp, err := c.Client.ModuleInstallWithResponse(context.Background(), mod_management.ModuleInstallJSONRequestBody{
Name: name,
})
if err != nil {
return err
}

if resp.StatusCode() != http.StatusOK {
return fmt.Errorf("failed to get installable modules: %s", resp.Status())
}
return nil
}
func (c *ModManagementClient) InstallModuleAsync(name string) error {
resp, err := c.Client.ModuleInstallAsyncWithResponse(context.Background(), mod_management.ModuleInstallJSONRequestBody{
Name: name,
})
if err != nil {
return err
}
Expand Down

0 comments on commit f452937

Please sign in to comment.