diff --git a/web/CXM_web_arg_utils.anubis b/web/CXM_web_arg_utils.anubis index 18ed9cb..f96b433 100644 --- a/web/CXM_web_arg_utils.anubis +++ b/web/CXM_web_arg_utils.anubis @@ -9,27 +9,41 @@ transmit tools/basis.anubis transmit calexium_lib/web/CXM_common.anubis transmit calexium_lib/database/db_types.anubis -public define DB_id - get_DB_id +public define Maybe(DB_id) + get_mb_DB_id ( List(Web_arg) lwa, String arg_name ) = if web_arg_value(lwa, arg_name) is { - not_found then none, + not_found then failure, found(value) then //Check if value is none which means no id provided if value="none" then - none + success(none) else //Now try to convert the string into Int to get the id if decimal_scan(value) is { - failure then none, - success(_value) then db_id(_value) + failure then success(none), + success(_value) then success(db_id(_value)) } - }. + } +. + +public define DB_id + get_DB_id + ( + List(Web_arg) lwa, + String arg_name + ) = + if get_mb_DB_id(lwa, arg_name) is + { + failure then none, + success(value) then value + } +. public define Maybe(DB_date) get_DB_date -- libgit2 0.21.4