mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
fix: community function import
This commit is contained in:
parent
93205d4320
commit
72168b1586
1 changed files with 6 additions and 1 deletions
|
|
@ -626,7 +626,12 @@
|
||||||
const _functions = JSON.parse(event.target.result);
|
const _functions = JSON.parse(event.target.result);
|
||||||
console.log(_functions);
|
console.log(_functions);
|
||||||
|
|
||||||
for (const func of _functions) {
|
for (let func of _functions) {
|
||||||
|
if ('function' in func) {
|
||||||
|
// Required for Community JSON import
|
||||||
|
func = func.function;
|
||||||
|
}
|
||||||
|
|
||||||
const res = await createNewFunction(localStorage.token, func).catch((error) => {
|
const res = await createNewFunction(localStorage.token, func).catch((error) => {
|
||||||
toast.error(`${error}`);
|
toast.error(`${error}`);
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue