Commit 82093523 authored by Sebastian Seufert's avatar Sebastian Seufert
Browse files

- better comments for case disctinctions in handlers

parent c33b46d3
......@@ -182,7 +182,7 @@ assert_dict(D,Acc) :-
%
clear_bg(Req) :-
option(content_length(0),Req)
-> action_reply_success(400, clear_bg, 'no change (is the body empty?)')
-> action_reply_success_dict(400, _{received_empty_body:true})
;
http_read_json_dict(Req, Dict,[value_string_as(atom), tag(type)]),
catch(
......@@ -194,13 +194,14 @@ clear_bg(Req) :-
)
),
E, throw(server_error(E))
),
(
),
length(Failed, FailedCnt),
Diff is (Length - FailedCnt),
( % Failed is empty iff we removed successfully all requested items
% ToDo: Remove case or modify return code
Failed == []
-> action_reply_success_dict(200, _{received:Length,removed:Length})
; length(Failed, FailedCnt),
Diff is (Length - FailedCnt),
action_reply_success_dict(200, _{received:Length,removed:Diff,skipped:FailedCnt})
-> action_reply_success_dict(200, _{received:Length,removed:Diff,skipped:FailedCnt})
; action_reply_success_dict(200, _{received:Length,removed:Diff,skipped:FailedCnt})
).
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment