fix(fe pllaylist): fixed axios calls and added create call
This commit is contained in:
parent
51c056f1a2
commit
e62558eba0
1 changed files with 10 additions and 3 deletions
|
@ -47,10 +47,17 @@ export function playlist_page() {
|
|||
})
|
||||
}
|
||||
|
||||
const createItem = async (item) => {
|
||||
return await axios.post(`playlist`, item
|
||||
).then((response) => {
|
||||
console.log(response)
|
||||
})
|
||||
}
|
||||
|
||||
const editItem = (item) => {
|
||||
item['_method'] = 'PUT'
|
||||
|
||||
return axios.post(`file/${item.id}`, item
|
||||
return axios.post(`playlist/${item.id}`, item
|
||||
).then((response) => {
|
||||
console.log(response)
|
||||
})
|
||||
|
@ -58,7 +65,7 @@ export function playlist_page() {
|
|||
|
||||
const deleteItem = (id) => {
|
||||
|
||||
return axios.post(`file/${id}`, {
|
||||
return axios.post(`playlist/${id}`, {
|
||||
_method: 'DELETE'
|
||||
}).then((response) => {
|
||||
getItems(listData)
|
||||
|
@ -66,5 +73,5 @@ export function playlist_page() {
|
|||
})
|
||||
}
|
||||
|
||||
return { items, listData, headers, selected, loading, search, getItems, editItem, deleteItem }
|
||||
return { items, listData, headers, selected, loading, search, getItems, createItem, editItem, deleteItem }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue