enh: list valve

This commit is contained in:
Timothy J. Baek 2024-06-23 19:49:48 -07:00
parent 0250f69da0
commit f4a2ae5eac

View File

@ -30,6 +30,14 @@
const submitHandler = async () => {
saving = true;
if (valvesSpec) {
// Convert string to array
for (const property in valvesSpec.properties) {
if (valvesSpec.properties[property]?.type === 'array') {
valves[property] = (valves[property] ?? '').split(',').map((v) => v.trim());
}
}
let res = null;
if (type === 'tool') {
@ -45,6 +53,7 @@
if (res) {
toast.success('Valves updated successfully');
}
}
saving = false;
};
@ -66,6 +75,15 @@
valves = {};
}
if (valvesSpec) {
// Convert array to string
for (const property in valvesSpec.properties) {
if (valvesSpec.properties[property]?.type === 'array') {
valves[property] = (valves[property] ?? []).join(',');
}
}
}
loading = false;
};