diff --git a/src/pages/files/index.jsx b/src/pages/files/index.jsx index 93de7e5..09c1273 100644 --- a/src/pages/files/index.jsx +++ b/src/pages/files/index.jsx @@ -22,7 +22,7 @@ const Files = () => { } }) .catch((err) => { - setNotification(true, err.response.data.error); + setNotification(true, err.message); }); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/src/pages/playlists/index.jsx b/src/pages/playlists/index.jsx index 359f44e..3554368 100644 --- a/src/pages/playlists/index.jsx +++ b/src/pages/playlists/index.jsx @@ -3,6 +3,7 @@ import NavbarSignage from '../../components/navbar'; import PlaylistTable from './playlist-table'; import API from '../../services/api'; import setNotification from '../errors/error-notification'; +import ModalCreatePlaylist from './create'; const Playlists = () => { const [showCreate, setShowCreate] = useState(false); @@ -38,6 +39,10 @@ const Playlists = () => { setPage((prev) => prev + limit); }; + const addPlaylist = (playlist) => { + setPlaylist((prev) => [...prev, playlist]); + }; + const navbar = { title: 'Playlists', search: search, @@ -59,6 +64,11 @@ const Playlists = () => { updateHandler={toggleModalUpdate} loadMore={loadMore} /> + addPlaylist(playlist)} + /> ); };