function addCommentRelation(comment) {
  const data = {
    "comments": {
      "__op": "AddRelation",
      "objects": [
        {
          "className": comment.className,
          "__type": "Pointer",
          "objectId": comment.objectId
        }
      ]
    }
  }

  const promise = fetch(`${DevineApiConfig.url}classes/Comment`, {
    method: 'POST',
    headers: {...DevineApiConfig.apiKeys},
    body: JSON.stringify(data)
  }).then(res => res.json())

  return {
    type: actionTypes.ADD_COMMENT_RELATION,
    payload: {
      promise
    }
  }
}
/**
 * After the comment has been posted, add the comment object as a relation to the parent feed item.
 *
 * @param {object} comment
 * @return {object} promise
 */
After the comment has been posted, add the comment object as a relation to the parent feed item.
@param {object} comment
@return {object} promise
After the comment has been posted add the comment object as a relation to the parent feed item . @param { object } comment @return { object } promise
function addCommentRelation(comment) {
  const data = {
    "comments": {
      "__op": "AddRelation",
      "objects": [
        {
          "className": comment.className,
          "__type": "Pointer",
          "objectId": comment.objectId
        }
      ]
    }
  }
  const promise = fetch(`${DevineApiConfig.url}classes/Comment`, {
    method: 'POST',
    headers: {...DevineApiConfig.apiKeys},
    body: JSON.stringify(data)
  }).then(res => res.json())
  return {
    type: actionTypes.ADD_COMMENT_RELATION,
    payload: {
      promise
    }
  }
}
function addCommentRelation ( comment ) { const data = { "comments" : { "__op" : "AddRelation" , "objects" : [ { "className" : comment . className , "__type" : "Pointer" , "objectId" : comment . objectId } ] } } const promise = fetch ( ` ${ DevineApiConfig . url } ` , { method : 'POST' , headers : { ... DevineApiConfig . apiKeys } , body : JSON . stringify ( data ) } ) . then ( res => res . json ( ) ) return { type : actionTypes . ADD_COMMENT_RELATION , payload : { promise } } }
After the comment has been posted, add the comment object as a relation to the parent feed item.
After the comment has been posted add the comment object as a relation to the parent feed item .