Skip to content

Commit

Permalink
Threat status 204 of API
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Mar 23, 2022
1 parent c8dd8df commit 30b67e0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/provider/resource_tsuru_app_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ func resourceTsuruApplicationRouterRead(ctx context.Context, d *schema.ResourceD
appName := parts[0]
name := parts[1]

routers, _, err := provider.TsuruClient.AppApi.AppRouterList(ctx, appName)
routers, resp, err := provider.TsuruClient.AppApi.AppRouterList(ctx, appName)

// wpjunior: it is a workaround for threating the response 204 of API
if resp != nil && resp.StatusCode == http.StatusNoContent {
d.SetId("")
return nil
}

if err != nil {
if isNotFoundError(err) {
d.SetId("")
Expand Down

0 comments on commit 30b67e0

Please sign in to comment.