fix: fix add resource with keys as objects

This commit is contained in:
Ruben Fiszel
2024-01-24 14:43:14 +01:00
parent 450267a84e
commit 0c88abccf0
+12 -6
View File
@@ -215,10 +215,14 @@
(o) => nativeLanguagesCategory?.includes(o[0]) ?? false
)
filteredConnectsManual = [
...(filteredNativeLanguages ?? []),
...(filteredConnectsManual ?? []).filter(([key, _]) => !nativeLanguagesCategory.includes(key))
]
try {
filteredConnectsManual = [
...(filteredNativeLanguages ?? []),
...(filteredConnectsManual ?? []).filter(
([key, _]) => !nativeLanguagesCategory.includes(key)
)
]
} catch (e) {}
}
async function next() {
@@ -274,9 +278,11 @@
const resourceValue = args
let saveVariable = false
if (!manual || linkedSecret != undefined) {
let v = manual ? args[linkedSecret ?? ''] : value
if (!v.startsWith('$var:')) {
if (typeof v == 'string' && v != '' && !v.startsWith('$var:')) {
saveVariable = true
await VariableService.createVariable({
workspace: $workspaceStore!,
requestBody: {
@@ -304,7 +310,7 @@
}
})
dispatch('refresh', path)
sendUserToast(`App token set at resource and variable path: ${path}`)
sendUserToast(`Saved resource${saveVariable ? ' and variable' : ''} path: ${path}`)
drawer.closeDrawer?.()
}
}