ContentTools icon indicating copy to clipboard operation
ContentTools copied to clipboard

Editor save event not successful

Open elsaroze opened this issue 6 years ago • 4 comments

Hi, been trying to save edited information on my site but the tick or X that appears in the demo in the middle of the page is not showing on my site plus the gears that replace the pencil icon on editing is not appearing...could it be something in my editor.js file that is making it so? File pasted below editor.txt

elsaroze avatar May 12 '19 10:05 elsaroze

Make sure, the backend which receives xhr.open('POST', '/x/save-page‘) responds with the HTTP status code 200 OK, since your editor recognizes only this one. Other valid status codes may be 201 Created, 202 Accepted and 204 No Content. The last one sounds strange, but it means that the POST data has been received and acted upon, but only did not produce any result (content) which would have been necessary to return to the client.

In addition to 200, my backend responds with 204, 201 and 304 if everything went OK, or with 400, 404 and 500 otherwise.

cyclaero avatar May 12 '19 14:05 cyclaero

Hi, I have changed the line xhr.open('POST', '/x/save-page‘) to xhr.open('POST', 'index.html‘) and the POST returns 200 but the changes have not been effected still

elsaroze avatar May 13 '19 04:05 elsaroze

The Status is 200 OK but no changes committed to the file when I reload the page it still shows the same

elsaroze avatar May 13 '19 05:05 elsaroze

Posting to the index.html file likely means your changes aren't saved as I'm assuming index.html is just responsible for displaying the content of the home page not saving them. What doesn't you /x/save-page view respond with?

anthonyjb avatar Jun 13 '19 11:06 anthonyjb