1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-07-01 23:20:13 +02:00

fix: error message typo

This commit is contained in:
Elias Schneider 2023-01-06 09:21:46 +01:00
parent f2d4895e50
commit 72c8081e7c
3 changed files with 7 additions and 11 deletions

View File

@ -115,9 +115,10 @@ const AdminConfigTable = () => {
if (config.get("SETUP_FINISHED")) { if (config.get("SETUP_FINISHED")) {
configService configService
.updateMany(updatedConfigVariables) .updateMany(updatedConfigVariables)
.then(() => .then(() => {
toast.success("Configurations updated successfully") updatedConfigVariables = [];
) toast.success("Configurations updated successfully");
})
.catch(toast.axiosError); .catch(toast.axiosError);
} else { } else {
configService configService

View File

@ -1,6 +1,5 @@
import { Button, Group } from "@mantine/core"; import { Button, Group } from "@mantine/core";
import { useModals } from "@mantine/modals"; import { useModals } from "@mantine/modals";
import axios from "axios";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import pLimit from "p-limit"; import pLimit from "p-limit";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@ -63,11 +62,7 @@ const Upload = () => {
await Promise.all(uploadPromises); await Promise.all(uploadPromises);
} catch (e) { } catch (e) {
if (axios.isAxiosError(e)) { toast.axiosError(e);
toast.error(e.response?.data?.message ?? "An unkown error occured.");
} else {
toast.error("An unkown error occured.");
}
setisUploading(false); setisUploading(false);
} }
}; };
@ -93,7 +88,7 @@ const Upload = () => {
setFiles([]); setFiles([]);
}) })
.catch(() => .catch(() =>
toast.error("An error occured while finishing your share.") toast.error("An error occurred while finishing your share.")
); );
} }
} }

View File

@ -11,7 +11,7 @@ const error = (message: string) =>
}); });
const axiosError = (axiosError: any) => const axiosError = (axiosError: any) =>
error(axiosError?.response?.data?.message ?? "An unknown error occured"); error(axiosError?.response?.data?.message ?? "An unknown error occurred");
const success = (message: string) => const success = (message: string) =>
showNotification({ showNotification({