Skip to content

Commit 077d44d

Browse files
authored
Merge pull request #170 from ovh/me
fix(browser): add missing /v1 prefix to instance API endpoints
2 parents 11351ce + b9a80ce commit 077d44d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

internal/services/account/account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var (
3535
)
3636

3737
func GetMe(_ *cobra.Command, _ []string) {
38-
common.ManageObjectRequest("/me", "", meTemplate)
38+
common.ManageObjectRequest("/v1/me", "", meTemplate)
3939
}
4040

4141
func ListSSHKeys(_ *cobra.Command, _ []string) {

internal/services/browser/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ func (m Model) fetchImages(region string) tea.Cmd {
15891589
// deleteInstance deletes an instance by its ID
15901590
func (m Model) deleteInstance(instanceId string) tea.Cmd {
15911591
return func() tea.Msg {
1592-
endpoint := fmt.Sprintf("/cloud/project/%s/instance/%s", m.cloudProject, instanceId)
1592+
endpoint := fmt.Sprintf("/v1/cloud/project/%s/instance/%s", m.cloudProject, instanceId)
15931593
err := httpLib.Client.Delete(endpoint, nil)
15941594
if err != nil {
15951595
return instanceDeletedMsg{err: fmt.Errorf("failed to delete instance: %w", err)}
@@ -2128,7 +2128,7 @@ func (m Model) cleanupCreatedResources() tea.Cmd {
21282128

21292129
// Delete instance if created
21302130
if m.wizard.createdInstanceId != "" {
2131-
endpoint := fmt.Sprintf("/cloud/project/%s/instance/%s", m.cloudProject, m.wizard.createdInstanceId)
2131+
endpoint := fmt.Sprintf("/v1/cloud/project/%s/instance/%s", m.cloudProject, m.wizard.createdInstanceId)
21322132
if err := httpLib.Client.Delete(endpoint, nil); err != nil {
21332133
errors = append(errors, fmt.Sprintf("Instance: %s", err))
21342134
} else {

0 commit comments

Comments
 (0)