Skip to content

Commit

Permalink
Merge pull request #26 from OpenVPN/feature/fixed-route-update
Browse files Browse the repository at this point in the history
Fixed route update method
  • Loading branch information
sahaqaa authored Jul 29, 2024
2 parents 6de4b5e + 1e46d23 commit 25f8425
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cloudconnexa/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,16 @@ func (c *RoutesService) Create(networkId string, route Route) (*Route, error) {
}

func (c *RoutesService) Update(networkId string, route Route) error {
routeJson, err := json.Marshal(route)
type updatedRoute struct {
Description string `json:"description"`
Value string `json:"value"`
}
routeToUpdate := updatedRoute{
Description: route.Description,
Value: route.Subnet,
}

routeJson, err := json.Marshal(routeToUpdate)
if err != nil {
return err
}
Expand Down

0 comments on commit 25f8425

Please sign in to comment.