From ba6dc71810a4af0a73f45b80feb6604f73067c35 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 30 Nov 2024 00:10:30 -0800 Subject: [PATCH] refac: model editor --- .../components/workspace/Models/ModelEditor.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte index 956f13268..b184d5d5d 100644 --- a/src/lib/components/workspace/Models/ModelEditor.svelte +++ b/src/lib/components/workspace/Models/ModelEditor.svelte @@ -15,6 +15,7 @@ import { getKnowledgeBases } from '$lib/apis/knowledge'; import AccessControl from '../common/AccessControl.svelte'; import { stringify } from 'postcss'; + import { toast } from 'svelte-sonner'; const i18n = getContext('i18n'); @@ -103,6 +104,14 @@ info.id = id; info.name = name; + if (id === '') { + toast.error('Model ID is required.'); + } + + if (name === '') { + toast.error('Model Name is required.'); + } + info.access_control = accessControl; info.meta.capabilities = capabilities; @@ -425,12 +434,11 @@
-