wip: direct models
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { onMount, getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { functions, models } from '$lib/stores';
|
||||
import { functions, models, settings } from '$lib/stores';
|
||||
import { createNewFunction, getFunctions } from '$lib/apis/functions';
|
||||
import FunctionEditor from '$lib/components/admin/Functions/FunctionEditor.svelte';
|
||||
import { getModels } from '$lib/apis';
|
||||
@@ -47,7 +47,7 @@
|
||||
if (res) {
|
||||
toast.success($i18n.t('Function created successfully'));
|
||||
functions.set(await getFunctions(localStorage.token));
|
||||
models.set(await getModels(localStorage.token));
|
||||
models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
||||
|
||||
await goto('/admin/functions');
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { functions, models } from '$lib/stores';
|
||||
import { functions, models, settings } from '$lib/stores';
|
||||
import { updateFunctionById, getFunctions, getFunctionById } from '$lib/apis/functions';
|
||||
|
||||
import FunctionEditor from '$lib/components/admin/Functions/FunctionEditor.svelte';
|
||||
@@ -48,7 +48,7 @@
|
||||
if (res) {
|
||||
toast.success($i18n.t('Function updated successfully'));
|
||||
functions.set(await getFunctions(localStorage.token));
|
||||
models.set(await getModels(localStorage.token));
|
||||
models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user