Browse Source

include collection and id in postparams

this changes the JSON tags to include both the ID and Collection
in PostParams. Both will be omitted when empty to maintain any unknown
backwards compatibility.
Rob Loranger 5 months ago
parent
commit
3e525f7a24
No account linked to committer's email
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      post.go

+ 2
- 2
post.go View File

@@ -38,7 +38,7 @@ type (
38 38
 	// PostParams holds values for creating or updating a post.
39 39
 	PostParams struct {
40 40
 		// Parameters only for updating
41
-		ID    string `json:"-"`
41
+		ID    string `json:"id,omitempty"`
42 42
 		Token string `json:"token,omitempty"`
43 43
 
44 44
 		// Parameters for creating or updating
@@ -55,7 +55,7 @@ type (
55 55
 		Crosspost []map[string]string `json:"crosspost,omitempty"`
56 56
 
57 57
 		// Parameters for collection posts
58
-		Collection string `json:"-"`
58
+		Collection string `json:"collection,omitempty"`
59 59
 	}
60 60
 
61 61
 	// PinnedPostParams holds values for pinning a post