docs: fix WRAPPERS.md replacement examples
- update_post wrapper example now uses correct parameters (post_text, post_path) - create_comment wrapper example shows post_key parameter option
This commit is contained in:
parent
7e0244d49c
commit
4f0c06771d
1 changed files with 12 additions and 9 deletions
|
|
@ -426,33 +426,36 @@ API.run_job('post.create', {
|
|||
```python
|
||||
# Wrapper
|
||||
API.wrapped(update_post(
|
||||
post_id="current-pk-same-as-sk",
|
||||
new_post_text="New content"
|
||||
post_text="New content",
|
||||
post_path="my-post-slug",
|
||||
parent_path="/music"
|
||||
))
|
||||
|
||||
# Job
|
||||
API.run_job('post.update', {
|
||||
"pk": "current-pk-same-as-sk",
|
||||
"sk": "current-pk-same-as-sk",
|
||||
"newPostText": "New content"
|
||||
"key": {
|
||||
"pk": "post#my-post-slug",
|
||||
"sk": "post#my-post-slug"
|
||||
},
|
||||
"postText": "New content"
|
||||
})
|
||||
```
|
||||
|
||||
**Example 3: Create Comment**
|
||||
|
||||
```python
|
||||
# Wrapper
|
||||
# Wrapper - Using post_key
|
||||
API.wrapped(create_comment(
|
||||
"My comment",
|
||||
parent_path="/post-id"
|
||||
post_key={"pk": "post#123", "sk": "post#123"}
|
||||
))
|
||||
|
||||
# Job
|
||||
API.run_job('comment.create', {
|
||||
"commentText": "My comment",
|
||||
"parent": {
|
||||
"pk": "post-id",
|
||||
"sk": "post-id"
|
||||
"pk": "post#123",
|
||||
"sk": "post#123"
|
||||
}
|
||||
})
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue