Skip to content

Commit d66ef4c

Browse files
committed
map end and start params to toDate and fromDate
1 parent b6a0994 commit d66ef4c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modules/api.xqm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ declare function api:validate-toDate($model as map(*)) as map(*)? {
800800
: Check parameter start
801801
~:)
802802
declare function api:validate-start($model as map(*)) as map(*)? {
803-
if($model('start') castable as xs:date) then $model
803+
if($model('start') castable as xs:date) then (map:put($model, 'fromDate', $model('start')) => map:remove('start'))
804804
else if($model?start ='') then () (: an empty string is simply dropped :)
805805
else error($api:INVALID_PARAMETER, 'Unsupported date format given: "' || $model('start') || '". Should be YYYY-MM-DD.')
806806
};
@@ -809,7 +809,7 @@ declare function api:validate-start($model as map(*)) as map(*)? {
809809
: Check parameter end
810810
~:)
811811
declare function api:validate-end($model as map(*)) as map(*)? {
812-
if($model('end') castable as xs:date) then $model
812+
if($model('end') castable as xs:date) then (map:put($model, 'toDate', $model('end')) => map:remove('end'))
813813
else if($model?end ='') then () (: an empty string is simply dropped :)
814814
else error($api:INVALID_PARAMETER, 'Unsupported date format given: "' || $model('end') || '". Should be YYYY-MM-DD.')
815815
};

0 commit comments

Comments
 (0)