refac: toast error
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
meta: data.meta,
|
||||
content: data.content
|
||||
}).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
meta: data.meta,
|
||||
content: data.content
|
||||
}).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
if (id) {
|
||||
func = await getFunctionById(localStorage.token, id).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
goto('/admin/functions');
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
params: { ...modelInfo.params }
|
||||
}).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
let prompt = null;
|
||||
const onSubmit = async (_prompt) => {
|
||||
const prompt = await createNewPrompt(localStorage.token, _prompt).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
const onSubmit = async (_prompt) => {
|
||||
console.log(_prompt);
|
||||
const prompt = await updatePromptByCommand(localStorage.token, _prompt).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
localStorage.token,
|
||||
command.replace(/\//g, '')
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
content: data.content,
|
||||
access_control: data.access_control
|
||||
}).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
content: data.content,
|
||||
access_control: data.access_control
|
||||
}).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
if (id) {
|
||||
tool = await getToolById(localStorage.token, id).catch((error) => {
|
||||
toast.error(error);
|
||||
toast.error(`${error}`);
|
||||
goto('/workspace/tools');
|
||||
return null;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user