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

View File

@@ -61,7 +61,7 @@
const shareHandler = async (func) => {
const item = await getFunctionById(localStorage.token, func.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -88,7 +88,7 @@
const cloneHandler = async (func) => {
const _function = await getFunctionById(localStorage.token, func.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -104,7 +104,7 @@
const exportHandler = async (func) => {
const _function = await getFunctionById(localStorage.token, func.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -118,7 +118,7 @@
const deleteHandler = async (func) => {
const res = await deleteFunctionById(localStorage.token, func.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -132,7 +132,7 @@
const toggleGlobalHandler = async (func) => {
const res = await toggleGlobalById(localStorage.token, func.id).catch((error) => {
toast.error(error);
toast.error(`${error}`);
});
if (res) {
@@ -418,7 +418,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 _functions = await exportFunctions(localStorage.token).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
@@ -510,7 +510,7 @@
for (const func of _functions) {
const res = await createNewFunction(localStorage.token, func).catch((error) => {
toast.error(error);
toast.error(`${error}`);
return null;
});
}