You can only edit your comments if the current page is using the .
Since comments are saved using versioned structured data (type 501), everyone will be able to see old comments by .
Contents
The plugin fetches a data identifier handle for the comment you want to edit.
Copy GET /appendable-data/:handleId/:index
Copy window.safeAppendableData.getDataIdAt(
this._authToken, this._currentPostHandleId, index)
Get a structured data handle
The plugin fetches a structured data handle using the data identifier handle previously obtained.
Copy GET /structured-data/handle/:dataIdHandle
Copy window.safeStructuredData.getHandle(this._authToken, address)
Update the structured data
The plugin updates the structured data handle with the new version of the comment.
Copy const payload = new Buffer(JSON.stringify({
name: original.name,
comment: newText,
time: original.time, // we keep the original time so the order stays intact
editedTime: (new Date()).getTime()
})).toString('base64')
Copy PATCH /structured-data/:handleId
Copy window.safeStructuredData.updateData(this._authToken, handleId, payload)
Save the structured data
The plugin saves the new version of the comment by sending a POST request to the SAFE Network.
Copy POST /structured-data/:handleId
Copy window.safeStructuredData.post(this._authToken, handleId)
Drop the structured data handle
The plugin drops the structured data handle of the comment.
Copy DELETE /structured-data/handle/:handleId
Copy window.safeStructuredData.dropHandle(this._authToken, dataIdHandle)
Drop the data identifier handle
The plugin drops the data identifier handle of the comment.
Copy DELETE /data-id/:handleId
Copy window.safeDataId.dropHandle(this._authToken, dataIdHandle)