api
This commit is contained in:
parent
cc3e592d25
commit
318f6f9d8f
27
src/services/api.js
Normal file
27
src/services/api.js
Normal file
@ -0,0 +1,27 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const caller = (url = '/api') => {
|
||||
return axios.create({
|
||||
baseURL: url,
|
||||
});
|
||||
};
|
||||
|
||||
const API = {
|
||||
listPlaylists(data) {
|
||||
return caller().get('/playlist', data);
|
||||
},
|
||||
createPlaylist(data) {
|
||||
return caller().put('/playlist', data);
|
||||
},
|
||||
getPlaylist(id) {
|
||||
return caller().get(`/playlist/${id}`);
|
||||
},
|
||||
upload(data) {
|
||||
return caller().post('/file', data);
|
||||
},
|
||||
getFiles() {
|
||||
return caller().get('/file');
|
||||
},
|
||||
};
|
||||
|
||||
export default API;
|
Loading…
Reference in New Issue
Block a user