Skip to content
Snippets Groups Projects
Commit c03ea157 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Add function stringListToSelect2DataArray

parent 68a7edba
No related branches found
No related tags found
No related merge requests found
......@@ -41,4 +41,16 @@ module.exports = {
const host = pathArray[2];
return protocol + '//' + host;
},
/**
* Converts a string list to a data array for Select2
*
* @param list
* @returns {Array}
*/
stringListToSelect2DataArray: (list) => {
let data = [];
list.forEach((item) => {data.push({id: item, text: item})});
return data;
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment