mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 17:04:37 +08:00
Updating posting to support new framework
This commit is contained in:
@@ -183,7 +183,7 @@ export function postItem (data, type, id) {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(item)
|
||||
}
|
||||
return fetch('/v1/item', options)
|
||||
return fetch('api/v1/' + type, options)
|
||||
.then(
|
||||
response => {
|
||||
return response.ok ? response.json()
|
||||
@@ -191,7 +191,6 @@ export function postItem (data, type, id) {
|
||||
}
|
||||
)
|
||||
.then((json) => {
|
||||
// Patch until ID is returned from backend
|
||||
dispatch(addItem(json))
|
||||
return json.id
|
||||
})
|
||||
|
||||
@@ -25,10 +25,10 @@ class CommentBox extends Component {
|
||||
let related
|
||||
if (reply) {
|
||||
comment.parent_id = item_id
|
||||
related = 'child'
|
||||
related = 'children'
|
||||
} else {
|
||||
comment.asset_id = item_id
|
||||
related = 'comment'
|
||||
related = 'comments'
|
||||
}
|
||||
updateItem(item_id, 'showReply', false)
|
||||
postItem(comment, 'comment')
|
||||
|
||||
Reference in New Issue
Block a user