upgrade operations #TODO complete dispatches
parent
553feb7c62
commit
6a7d045405
|
|
@ -55,7 +55,10 @@ export const createTrackRow = async ( track, token ) => {
|
||||||
trackRowEndpoint,
|
trackRowEndpoint,
|
||||||
track,
|
track,
|
||||||
token
|
token
|
||||||
)
|
).then( response => {
|
||||||
|
dispatch( actions.addRow( response ) )
|
||||||
|
return response
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateTrackRow = async ( id, track, token ) => {
|
export const updateTrackRow = async ( id, track, token ) => {
|
||||||
|
|
@ -73,4 +76,27 @@ export const deleteTrackRow = async ( id ) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track Ratings CRUD
|
// Track Ratings CRUD
|
||||||
|
|
||||||
|
export const getAllTrackRating = (id) => async ( dispatch ) => {
|
||||||
|
return await AppService._getList(
|
||||||
|
trackEndpoint + id + '/ratings/'
|
||||||
|
).then( response => {
|
||||||
|
dispatch( actions.getRatings( response ) )
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const createTrackRating = (track_id, rating, token) => {
|
||||||
|
return await AppService._post(
|
||||||
|
trackEndpoint + track_id + '/rating/',
|
||||||
|
rating,
|
||||||
|
token
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const deleteTrackRating = (track_id, rating_id, token) => {
|
||||||
|
return await AppService._delete(
|
||||||
|
trackEndpoint + track_id + '/rating/' + rating_id,
|
||||||
|
token
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue