From e4c209e951089cfa544b351a8275fb1884dacb2f Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Fri, 6 Oct 2023 00:51:35 +0200 Subject: [PATCH] doc(api): clarify code checking for errors --- src/modules/api.xql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/api.xql b/src/modules/api.xql index dd700e4..57ce29f 100644 --- a/src/modules/api.xql +++ b/src/modules/api.xql @@ -360,7 +360,14 @@ declare function api:incremental($request as map(*)) as map(*) { else ( let $write-lock := app:lock-write($config?path, "incremental") let $incremental := $actions?incremental($config) - let $errors := some $a in ($incremental?new?*, $incremental?del?*)?2 satisfies not($a) + + (: + Check if any of the previous additions or deletions did not succeed + Each action is an array with [path, success (, error)] + :) + let $results := ($incremental?new?*, $incremental?del?*)?2 + let $errors := some $result in $results satisfies not($result) + let $remove-lock := app:lock-remove($config?path) return