diff options
author | Alexander_Kabui | 2024-08-07 17:51:42 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2024-08-09 11:55:16 +0300 |
commit | 7ba2971ae78b46cc2278e50dcc8d4d8ab9111a6f (patch) | |
tree | d3b591abe4c1a8c9bb0835cf9e3ffee1fd37591d | |
parent | 91dadb486ee098ad65982ae97a3f2ae946b42e9e (diff) | |
download | gn-guile-7ba2971ae78b46cc2278e50dcc8d4d8ab9111a6f.tar.gz |
Use camelcase for json responses.
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | web/view/markdown.scm | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -68,7 +68,7 @@ curl -G -d "file_path=test.md" localhost:8091/edit ```json { -"path": "test.md", +"file_path": "test.md", "content": "Test for new user\n test 2 for line\n test 3 for new line\n ## real markdown two test\n", "hash": "ecd96f27c45301279150fbda411544687db1aa45" } @@ -125,7 +125,7 @@ curl -X POST http://127.0.0.1:8091/commit \ { "status": "200", "message": "Nothing to commit, working tree clean", -"commit-sha": "ecd96f27c45301279150fbda411544687db1aa45" +"commit_sha": "ecd96f27c45301279150fbda411544687db1aa45" } ``` diff --git a/web/view/markdown.scm b/web/view/markdown.scm index d147a8f..d561832 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -66,7 +66,7 @@ (if (file-exists? abs_path) (let* ((full_path (canonicalize-path abs_path)) (content (call-with-input-file full_path get-string-all)) (commit-sha (get-latest-commit-sha1 repo))) - `(("path" . ,query_path) + `(("file_path" . ,query_path) ("content" . ,content) ("hash" . ,commit-sha)) ) (throw 'file-error (string-append "the file path " abs_path " does not exists"))))) @@ -106,8 +106,8 @@ "--author" (format #f "~a <~a>" username email))) (git-commit-sha (get-latest-commit-sha1 repo))) (if (zero? git-commit-file) - `(("status" . "201") ("message" . "committed file successfully") ("content" . ,content) ("commit-sha" . ,git-commit-sha) ("commit-message" . ,commit-message) ) - `(("status" . "200") ("message" . "Nothing to commit, working tree clean") ("commit-sha" . ,git-commit-sha))))) + `(("status" . "201") ("message" . "committed file successfully") ("content" . ,content) ("commit_sha" . ,git-commit-sha) ("commit_message" . ,commit-message) ) + `(("status" . "200") ("message" . "Nothing to commit, working tree clean") ("commit_sha" . ,git-commit-sha))))) (#f (throw 'system-error (string-append file-path " File does not exist Error")))) (throw 'system-error (string-append repo " Is not a git repo.")))) |