Browse Source

Fix examples in README

Matt Baer 1 year ago
parent
commit
cf3c150ac9
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      README.md

+ 11
- 7
README.md View File

@@ -24,7 +24,7 @@ func main() {
24 24
 	c := writeas.NewClient()
25 25
 
26 26
 	// Publish a post
27
-	p, err := c.CreatePost(&PostParams{
27
+	p, err := c.CreatePost(&writeas.PostParams{
28 28
 		Title:   "Title!",
29 29
 		Content: "This is a post.",
30 30
 		Font:    "sans",
@@ -37,9 +37,11 @@ func main() {
37 37
 	token := p.Token
38 38
 
39 39
 	// Update a published post
40
-	p, err = c.UpdatePost(&PostParams{
41
-		ID:      p.ID,
42
-		Token:   token,
40
+	p, err = c.UpdatePost(&writeas.PostParams{
41
+		OwnedPostParams: writeas.OwnedPostParams{
42
+			ID:    p.ID,
43
+			Token: token,
44
+		},
43 45
 		Content: "Now it's been updated!",
44 46
 	})
45 47
 	if err != nil {
@@ -53,9 +55,11 @@ func main() {
53 55
 	}
54 56
 
55 57
 	// Delete a post
56
-	err = c.DeletePost(&PostParams{
57
-		ID:    p.ID,
58
-		Token: token,
58
+	err = c.DeletePost(&writeas.PostParams{
59
+		OwnedPostParams: writeas.OwnedPostParams{
60
+			ID:    p.ID,
61
+			Token: token,
62
+		},
59 63
 	})
60 64
 }
61 65
 ```