Allow editing tags for non-JSON documents
kaminski piotr.kaminski@ncia.nato.int
Thu, 25 Mar 2021 20:22:58 +0100
1 files changed,
3 insertions(+),
1 deletions(-)
jump to
M
src/litestorepkg/lib/api_v7.nim
→
src/litestorepkg/lib/api_v7.nim
@@ -707,7 +707,9 @@ else:
return resError(Http400, "Bad request: patch operation #$1 is malformed." % $c) c.inc if apply: - if origData.len > 0 and origData != data: + # when document is not JSON the origData is not defined + # the extra check allows editing tags for non-JSON documents + if origData != nil and origData.len > 0 and origData != data: try: var doc = LS.store.updateDocument(id, data.pretty, "application/json") if doc == "":