From f50528e50a9c38880dda9ab8e9aaeed13a4bc45f Mon Sep 17 00:00:00 2001 From: David Jay Date: Thu, 3 Nov 2016 10:07:01 -0700 Subject: [PATCH] Updating posting to support new framework --- client/coral-framework/store/actions/items.js | 3 +-- client/coral-plugin-commentbox/CommentBox.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/coral-framework/store/actions/items.js b/client/coral-framework/store/actions/items.js index 82bcca52f..7c5c908f9 100644 --- a/client/coral-framework/store/actions/items.js +++ b/client/coral-framework/store/actions/items.js @@ -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 }) diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index f20ced54c..6d56ecfde 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -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')