create new playlist
This commit is contained in:
parent
ca2262403b
commit
124e6dc894
@ -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
|
||||
}, []);
|
||||
|
@ -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}
|
||||
/>
|
||||
<ModalCreatePlaylist
|
||||
opened={showCreate}
|
||||
handler={toggleModalCreate}
|
||||
addPlaylist={(playlist) => addPlaylist(playlist)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user