This commit is contained in:
Timothy J. Baek
2024-06-20 04:51:51 -07:00
parent 59fa2f8f26
commit 9ebd308d28
3 changed files with 12 additions and 3 deletions
@@ -3,9 +3,10 @@
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { functions } from '$lib/stores';
import { functions, models } from '$lib/stores';
import { createNewFunction, getFunctions } from '$lib/apis/functions';
import FunctionEditor from '$lib/components/workspace/Functions/FunctionEditor.svelte';
import { getModels } from '$lib/apis';
let mounted = false;
let clone = false;
@@ -26,6 +27,8 @@
if (res) {
toast.success('Function created successfully');
functions.set(await getFunctions(localStorage.token));
models.set(await getModels(localStorage.token));
await goto('/workspace/functions');
}
};
@@ -4,11 +4,12 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { functions } from '$lib/stores';
import { functions, models } from '$lib/stores';
import { updateFunctionById, getFunctions, getFunctionById } from '$lib/apis/functions';
import FunctionEditor from '$lib/components/workspace/Functions/FunctionEditor.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
import { getModels } from '$lib/apis';
let func = null;
@@ -27,6 +28,7 @@
if (res) {
toast.success('Function updated successfully');
functions.set(await getFunctions(localStorage.token));
models.set(await getModels(localStorage.token));
}
};