Remove tracks from playlist

This commit is contained in:
Deluan
2020-05-16 18:10:08 -04:00
committed by Deluan Quintão
parent 5c95eed517
commit 12cf2f1104
6 changed files with 72 additions and 9 deletions
@@ -0,0 +1,22 @@
import React, { Fragment, useEffect } from 'react'
import { BulkDeleteButton, useUnselectAll } from 'react-admin'
import PropTypes from 'prop-types'
const PlaylistSongBulkActions = ({ playlistId, ...rest }) => {
const unselectAll = useUnselectAll()
useEffect(() => {
unselectAll('playlistTrack')
// eslint-disable-next-line
}, [])
return (
<Fragment>
<BulkDeleteButton {...rest} resource={`playlist/${playlistId}/tracks`} />
</Fragment>
)
}
PlaylistSongBulkActions.propTypes = {
playlistId: PropTypes.string.isRequired,
}
export default PlaylistSongBulkActions