@@ -143,7 +143,7 @@ def projectInfo(self) -> dict[str, Any]:
143
143
raise AttributeError ("Project not found" )
144
144
145
145
def post (self , headline : str , blocks : list = [], cws : list = [],
146
- tags : list = [], adult : bool = False , draft = False ):
146
+ tags : list = [], adult : bool = False , draft = False , shareOfPostId : int = None ):
147
147
# Basic flow: you send a POST to project/{handle}/posts
148
148
# This gives us back a post ID, as well as a API link
149
149
# For example:
@@ -209,8 +209,12 @@ def post(self, headline: str, blocks: list = [], cws: list = [],
209
209
'adultContent' : adult ,
210
210
'blocks' : blockL ,
211
211
'cws' : cws ,
212
- 'tags' : tags
212
+ 'tags' : tags ,
213
213
}
214
+ if shareOfPostId is not None :
215
+ postData .update ({
216
+ 'shareOfPostId' : shareOfPostId
217
+ })
214
218
req = fetch (
215
219
'postJSON' ,
216
220
'/project/{}/posts' .format (self .handle ),
@@ -237,6 +241,10 @@ def post(self, headline: str, blocks: list = [], cws: list = [],
237
241
'cws' : cws ,
238
242
'tags' : tags
239
243
}
244
+ if shareOfPostId is not None :
245
+ postData .update ({
246
+ 'shareOfPostId' : shareOfPostId
247
+ })
240
248
req = fetch (
241
249
'put' ,
242
250
'/project/{}/posts/{}' .format (self .handle , req ['postId' ]),
@@ -272,6 +280,7 @@ def editPost(self, postId: int,
272
280
'cws' : cws ,
273
281
'tags' : tags
274
282
}
283
+
275
284
req = fetch (
276
285
'put' ,
277
286
'/project/{}/posts/{}' .format (self .handle , postId ),
0 commit comments