all repos — litestore @ f076be8f2e0dc1ed0078082f374e1214f4cf3e39

A minimalist nosql document store.

Allow editing tags for non-JSON documents
kaminski piotr.kaminski@ncia.nato.int
Thu, 25 Mar 2021 20:22:58 +0100
commit

f076be8f2e0dc1ed0078082f374e1214f4cf3e39

parent

ce304550ad289a3029daed18e7111ad829e355ad

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/litestorepkg/lib/api_v7.nimsrc/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 == "":