Updating posting to support new framework

This commit is contained in:
David Jay
2016-11-03 10:07:01 -07:00
parent 83505417b0
commit f50528e50a
2 changed files with 3 additions and 4 deletions
@@ -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
})
+2 -2
View File
@@ -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')