Prettier
This commit is contained in:
@@ -1,9 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import { useDataProvider, useGetList, useNotify } from 'react-admin'
|
||||||
useDataProvider,
|
|
||||||
useGetList,
|
|
||||||
useNotify,
|
|
||||||
} from 'react-admin'
|
|
||||||
import { MenuItem } from '@material-ui/core'
|
import { MenuItem } from '@material-ui/core'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
@@ -25,7 +21,8 @@ export const addAlbumToPlaylist = (dataProvider, albumId, playlistId) =>
|
|||||||
.then((response) => response.data.map((song) => song.id))
|
.then((response) => response.data.map((song) => song.id))
|
||||||
.then((ids) => addTracksToPlaylist(dataProvider, ids, playlistId))
|
.then((ids) => addTracksToPlaylist(dataProvider, ids, playlistId))
|
||||||
|
|
||||||
const AddToPlaylistMenu = React.forwardRef(({ selectedIds, albumId, onClose }, ref) => {
|
const AddToPlaylistMenu = React.forwardRef(
|
||||||
|
({ selectedIds, albumId, onClose }, ref) => {
|
||||||
const notify = useNotify()
|
const notify = useNotify()
|
||||||
const dataProvider = useDataProvider()
|
const dataProvider = useDataProvider()
|
||||||
const { ids, data, loaded } = useGetList(
|
const { ids, data, loaded } = useGetList(
|
||||||
@@ -49,7 +46,7 @@ const AddToPlaylistMenu = React.forwardRef(({ selectedIds, albumId, onClose }, r
|
|||||||
|
|
||||||
add
|
add
|
||||||
.then((len) => {
|
.then((len) => {
|
||||||
notify('message.songsAddedToPlaylist', 'info', {smart_count: len})
|
notify('message.songsAddedToPlaylist', 'info', { smart_count: len })
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
notify('ra.page.error', 'warning')
|
notify('ra.page.error', 'warning')
|
||||||
@@ -68,7 +65,8 @@ const AddToPlaylistMenu = React.forwardRef(({ selectedIds, albumId, onClose }, r
|
|||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
AddToPlaylistMenu.propTypes = {
|
AddToPlaylistMenu.propTypes = {
|
||||||
selectedIds: PropTypes.arrayOf(PropTypes.any).isRequired,
|
selectedIds: PropTypes.arrayOf(PropTypes.any).isRequired,
|
||||||
|
|||||||
Reference in New Issue
Block a user