Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add filter option for "facsimile available" #361

Merged
merged 14 commits into from
Sep 16, 2020
Prev Previous commit
Next Next commit
silently drop empty strings
for fromDate and toDate
  • Loading branch information
peterstadler committed Sep 15, 2020
commit 8b5bd0ce71aa58e7abe192775c34b753625f3984
2 changes: 2 additions & 0 deletions modules/api.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ declare function api:validate-limit($model as map()) as map()? {
~:)
declare function api:validate-fromDate($model as map()) as map()? {
if($model('fromDate') castable as xs:date) then $model
else if($model?fromDate ='') then () (: an empty string is simply dropped :)
else error($api:INVALID_PARAMETER, 'Unsupported date format given: "' || $model('fromDate') || '". Should be YYYY-MM-DD.')
};

Expand All @@ -373,6 +374,7 @@ declare function api:validate-fromDate($model as map()) as map()? {
~:)
declare function api:validate-toDate($model as map()) as map()? {
if($model('toDate') castable as xs:date) then $model
else if($model?toDate ='') then () (: an empty string is simply dropped :)
else error($api:INVALID_PARAMETER, 'Unsupported date format given: "' || $model('toDate') || '". Should be YYYY-MM-DD.')
};

Expand Down