diff --git a/web/CXM_web_arg_utils.anubis b/web/CXM_web_arg_utils.anubis index 08ab07c..5d29452 100644 --- a/web/CXM_web_arg_utils.anubis +++ b/web/CXM_web_arg_utils.anubis @@ -162,7 +162,37 @@ public define DB_id success(value) then value } . - + +public define List(DB_id) + get_List_DB_id + ( + List(Web_arg) l, + String name + ) = + if l is + { + [] then [], + [h . t] then + if h is web_arg(n, value) then + if n = name then + //Check if value is none which means no id provided + with result = if value="none" then + 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) + }, + [ result . get_List_DB_id(t, name)] + else + get_List_DB_id(t, name) + else + get_List_DB_id(t, name) + } +. + public define Maybe(DB_date) get_DB_date ( @@ -264,7 +294,7 @@ public define String }. public define List(String) - get_String_list + get_List_String ( List(Web_arg) l, String name @@ -275,11 +305,11 @@ public define List(String) [h . t] then if h is web_arg(n, v) then if n = name then - [ v . get_String_list(t, name)] + [ v . get_List_String(t, name)] else - get_String_list(t, name) + get_List_String(t, name) else - get_String_list(t, name) + get_List_String(t, name) } . -- libgit2 0.21.4