Skip to content

Commit

Permalink
Add missing toast and fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulkrishh committed Jan 14, 2024
1 parent 0908567 commit 2e1aafd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/add/expenses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { incrementUsage } from 'app/dashboard/apis';
import { addExpense, editExpense } from 'app/dashboard/expenses/apis';
import { format } from 'date-fns';
import debounce from 'debounce';
import { toast } from 'sonner';

import AutoCompleteList from 'components/autocomplete-list';
import { useUser } from 'components/context/auth-provider';
Expand Down Expand Up @@ -81,13 +82,13 @@ export default function AddExpense({ show, onHide, mutate, selected, lookup }: A
incrementUsage();
}
setLoading(false);
toast({ description: `${isEditing ? messages.updated : messages.success}`, variant: 'success' });
toast.success(isEditing ? messages.updated : messages.success);
if (mutate) mutate();
onHide();
setState({ ...initialState });
} catch {
setLoading(false);
toast({ description: messages.error, variant: 'destructive' });
toast.error(messages.error);
}
};

Expand Down

1 comment on commit 2e1aafd

@vercel
Copy link

@vercel vercel bot commented on 2e1aafd Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.