all repos — litestore @ 68d46396460fb861bc3ef3d9fabff76c2d705fe6

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

68d46396460fb861bc3ef3d9fabff76c2d705fe6

parent

e77b5f3f431543c64562ae8d567ff3f52f2ac4ca

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 == "":