Skip to content

Commit

Permalink
update alert type
Browse files Browse the repository at this point in the history
  • Loading branch information
gconnect committed May 28, 2024
1 parent 0cc3b93 commit 950f043
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/frontend/next-app/app/utils/customAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import toast from "react-hot-toast";
import toast, { Renderable, Toast, ValueOrFunction } from "react-hot-toast";

type Message = ValueOrFunction<Renderable, Toast>;

export const successAlert = (message: string | undefined) => {
export const successAlert = (message: string | undefined | Message | any) => {
toast.success(message, {
position: 'bottom-right',
style: {
Expand All @@ -10,8 +11,8 @@ export const successAlert = (message: string | undefined) => {
)
}

export const errorAlert = (errorMessage: any) => {
toast.error(errorMessage.message, {
export const errorAlert = (errorMessage: Message | any) => {
toast.error(errorMessage, {
position: 'bottom-right',
style: {
paddingRight: '40px',
Expand Down

0 comments on commit 950f043

Please sign in to comment.