The function getData() in the file /api/v5/config.php can be optimized:
The optional values yet don't have any other functionality than to be mentionend in the optional_fields response parameter, when data is missing.
An improvement would be the ability to instead of currently doing this:
$data = getData(
"POST",
[
"table",
"columns",
"string",
"seperator",
"linebreak"
]
);
$global = (isset($data["global"])) ? $data["global"] : [];
$enclosure = (isset($data["enclosure"])) ? $data["enclosure"] : "";
example of /api/v5/csv/import endpoint
doing the following:
$data = getData(
"POST",
[
"table",
"columns",
"string",
"seperator",
"linebreak"
],
[
"global" => [], // "parameter as key" => "default value if not given"
"enclosure" => ""
]
);
The function
getData()in the file/api/v5/config.phpcan be optimized:The optional values yet don't have any other functionality than to be mentionend in the
optional_fieldsresponse parameter, when data is missing.An improvement would be the ability to instead of currently doing this:
example of
/api/v5/csv/importendpointdoing the following: