refac: toast error

This commit is contained in:
Timothy Jaeryang Baek
2025-01-20 22:41:32 -08:00
parent af48f346f1
commit a863f98c53
52 changed files with 123 additions and 123 deletions
@@ -136,7 +136,7 @@
// Check if the file is an audio file and transcribe/convert it to text file
if (['audio/mpeg', 'audio/wav', 'audio/ogg', 'audio/x-m4a'].includes(file['type'])) {
const res = await transcribeAudio(localStorage.token, file).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
+1 -1
View File
@@ -245,7 +245,7 @@
title: prompt.title,
content: prompt.content
}).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
}
+6 -6
View File
@@ -61,7 +61,7 @@
const shareHandler = async (tool) => {
const item = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -88,7 +88,7 @@
const cloneHandler = async (tool) => {
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -104,7 +104,7 @@
const exportHandler = async (tool) => {
const _tool = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -118,7 +118,7 @@
const deleteHandler = async (tool) => {
const res = await deleteToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -402,7 +402,7 @@
class="flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 transition"
on:click={async () => {
const _tools = await exportTools(localStorage.token).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -487,7 +487,7 @@
for (const tool of _tools) {
const res = await createNewTool(localStorage.token, tool).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
}
@@ -44,11 +44,11 @@
if (type === 'tool') {
res = await updateToolValvesById(localStorage.token, id, valves).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
} else if (type === 'function') {
res = await updateFunctionValvesById(localStorage.token, id, valves).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
}