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
|
```python
|
||||||
# Wrapper
|
# Wrapper
|
||||||
API.wrapped(update_post(
|
API.wrapped(update_post(
|
||||||
post_id="current-pk-same-as-sk",
|
post_text="New content",
|
||||||
new_post_text="New content"
|
post_path="my-post-slug",
|
||||||
|
parent_path="/music"
|
||||||
))
|
))
|
||||||
|
|
||||||
# Job
|
# Job
|
||||||
API.run_job('post.update', {
|
API.run_job('post.update', {
|
||||||
"pk": "current-pk-same-as-sk",
|
"key": {
|
||||||
"sk": "current-pk-same-as-sk",
|
"pk": "post#my-post-slug",
|
||||||
"newPostText": "New content"
|
"sk": "post#my-post-slug"
|
||||||
|
},
|
||||||
|
"postText": "New content"
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
**Example 3: Create Comment**
|
**Example 3: Create Comment**
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Wrapper
|
# Wrapper - Using post_key
|
||||||
API.wrapped(create_comment(
|
API.wrapped(create_comment(
|
||||||
"My comment",
|
"My comment",
|
||||||
parent_path="/post-id"
|
post_key={"pk": "post#123", "sk": "post#123"}
|
||||||
))
|
))
|
||||||
|
|
||||||
# Job
|
# Job
|
||||||
API.run_job('comment.create', {
|
API.run_job('comment.create', {
|
||||||
"commentText": "My comment",
|
"commentText": "My comment",
|
||||||
"parent": {
|
"parent": {
|
||||||
"pk": "post-id",
|
"pk": "post#123",
|
||||||
"sk": "post-id"
|
"sk": "post#123"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue