From 96dc8bf8d85f0a1ea89addbca289c6188bf1dd8b Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 7 Aug 2024 13:22:24 +0300 Subject: Update issue: integrate-markdown-editor-to-gn2. --- issues/integrate-markdown-editor-to-gn2.gmi | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'issues/integrate-markdown-editor-to-gn2.gmi') diff --git a/issues/integrate-markdown-editor-to-gn2.gmi b/issues/integrate-markdown-editor-to-gn2.gmi index dac0113..dd4c9b2 100644 --- a/issues/integrate-markdown-editor-to-gn2.gmi +++ b/issues/integrate-markdown-editor-to-gn2.gmi @@ -43,11 +43,13 @@ This is a `GET` request to retrieve file content. Make sure you pass a valid `fi **Edit Request Example:** ```bash -curl -G -d "filepath=test.md" -d "param2=value2" localhost:8091/edit + +curl -G -d "file_path=test.md" localhost:8091/edit ``` In case of a successful response, the expected result is: + ```json { "path": "", @@ -73,9 +75,25 @@ In case of an error, the expected response is: localhost:8091/commit ``` + +```bash + +curl -X POST http://127.0.0.1:8091/commit \ +-H 'Content-Type: application/json' \ +-d '{ +"content": "make test commit", +"filename": "test.md", +"email": "test@gmail.com", +"username": "test", +"commit_message": "init commit", +"prev_commit": "7cbfc40d98b49a64e98e7cd562f373053d0325bd" +}' + +``` + It expects the following data in JSON format: -* `content` (the data you want to commit to the file) +* `content` (the data you want to commit to the file, *valid markdown*) * `prev_commit` (required for integrity) * `filename` (file path to the file you are modifying) * `username` (identifier for the user, in our case from auth) -- cgit v1.2.3