feat: use different resource for listing songs in albums
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { fetchUtils } from 'react-admin'
|
||||
import jsonServerProvider from 'ra-data-json-server'
|
||||
|
||||
const baseUrl = '/app/api'
|
||||
|
||||
const httpClient = (url, options = {}) => {
|
||||
url = url.replace(baseUrl + '/albumSong', baseUrl + '/song')
|
||||
if (!options.headers) {
|
||||
options.headers = new Headers({ Accept: 'application/json' })
|
||||
}
|
||||
@@ -19,6 +22,6 @@ const httpClient = (url, options = {}) => {
|
||||
})
|
||||
}
|
||||
|
||||
const dataProvider = jsonServerProvider('/app/api', httpClient)
|
||||
const dataProvider = jsonServerProvider(baseUrl, httpClient)
|
||||
|
||||
export default dataProvider
|
||||
|
||||
Reference in New Issue
Block a user