Skip to content

Commit

Permalink
style(watchlist): create toaster for success adding watchlist
Browse files Browse the repository at this point in the history
  • Loading branch information
iqbalpa committed Jul 12, 2024
1 parent a1d41b4 commit 6c1960f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/detailMovie/detailMovie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { RootState } from '@/store/userStore';
import { Plus } from 'lucide-react';
import { addToWatchlist } from '@/api/watchlist.api';
import { getCookie } from 'cookies-next';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

interface IDetailMovieModule {
id: string;
Expand Down Expand Up @@ -51,6 +53,7 @@ const DetailMovieModule: React.FC<IDetailMovieModule> = ({ id }) => {
userId: user?.id,
};
const res = await addToWatchlist(accessToken, data);
toast.success('Movie added to watchlist');
console.log('added to watchlist');
console.log(res);
} catch (e) {
Expand Down

0 comments on commit 6c1960f

Please sign in to comment.