Skip to content

Commit

Permalink
fix: error message typo
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Jan 6, 2023
1 parent f2d4895 commit 72c8081
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ const AdminConfigTable = () => {
if (config.get("SETUP_FINISHED")) {
configService
.updateMany(updatedConfigVariables)
.then(() =>
toast.success("Configurations updated successfully")
)
.then(() => {
updatedConfigVariables = [];
toast.success("Configurations updated successfully");
})
.catch(toast.axiosError);
} else {
configService
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/pages/upload.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Group } from "@mantine/core";
import { useModals } from "@mantine/modals";
import axios from "axios";
import { useRouter } from "next/router";
import pLimit from "p-limit";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -63,11 +62,7 @@ const Upload = () => {

await Promise.all(uploadPromises);
} catch (e) {
if (axios.isAxiosError(e)) {
toast.error(e.response?.data?.message ?? "An unkown error occured.");
} else {
toast.error("An unkown error occured.");
}
toast.axiosError(e);
setisUploading(false);
}
};
Expand All @@ -93,7 +88,7 @@ const Upload = () => {
setFiles([]);
})
.catch(() =>
toast.error("An error occured while finishing your share.")
toast.error("An error occurred while finishing your share.")
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/toast.util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const error = (message: string) =>
});

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) =>
showNotification({
Expand Down

0 comments on commit 72c8081

Please sign in to comment.