V0.38.4 full composition (#237)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -26,19 +26,11 @@ export default function ConnectionsSection() {
|
||||
|
||||
const loadTypes = useCallback(async () => {
|
||||
try {
|
||||
const pkgs = await sw.api.admin.packages.list();
|
||||
const types = [];
|
||||
const seen = {};
|
||||
for (const pkg of (pkgs || [])) {
|
||||
const conns = pkg.manifest?.connections || [];
|
||||
for (const cd of conns) {
|
||||
if (!seen[cd.type]) {
|
||||
seen[cd.type] = true;
|
||||
types.push({ type: cd.type, label: cd.label || cd.type, packageId: pkg.id, fields: cd.fields || {} });
|
||||
}
|
||||
}
|
||||
}
|
||||
setConnTypes(types);
|
||||
const types = await sw.api.connectionTypes.list();
|
||||
setConnTypes((types || []).map(ct => ({
|
||||
type: ct.type, label: ct.label || ct.type,
|
||||
packageId: ct.package_id, fields: ct.fields || {}
|
||||
})));
|
||||
} catch (_) {}
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user