Skip to content

Commit adc9ab0

Browse files
author
Luis Neves
committed
[Fix] removed hardcoded space_id from test
1 parent ae40d49 commit adc9ab0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

resource_contentful_contenttype.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ func resourceContentTypeUpdate(d *schema.ResourceData, m interface{}) (err error
208208
ct.Description = description.(string)
209209
}
210210

211-
// Figure out if fields were removed
212211
if d.HasChange("field") {
213212
old, new := d.GetChange("field")
214213

@@ -221,6 +220,9 @@ func resourceContentTypeUpdate(d *schema.ResourceData, m interface{}) (err error
221220
}
222221
}
223222

223+
// To remove a field from a content type 4 API calls need to be made.
224+
// Ommit the removed fields and publish the new version of the content type,
225+
// followed by the field removal and final publish.
224226
if err = client.ContentTypes.Upsert(spaceID, ct); err != nil {
225227
return err
226228
}

resource_contentful_contenttype_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ var testAccContentfulContentTypeConfig = `
9393
// }
9494
9595
resource "contentful_contenttype" "mycontenttype" {
96-
// space_id = "${contentful_space.myspace.id}"
97-
space_id = "p025n8nykscm"
96+
space_id = "${contentful_space.myspace.id}"
9897
9998
name = "TF Acc Test CT 1"
10099
description = "Terraform Acc Test Content Type"

0 commit comments

Comments
 (0)