get list only

This commit is contained in:
jb-alvarado 2020-04-13 21:34:37 +02:00
parent e0ac6c2975
commit 3f2f09597f

View File

@ -13,22 +13,17 @@ export const actions = {
console.log(date) console.log(date)
const response = await this.$axios.get(`api/playlist/?date=${date}`, { headers: { Authorization: 'Bearer ' + rootState.auth.jwtToken } }) const response = await this.$axios.get(`api/playlist/?date=${date}`, { headers: { Authorization: 'Bearer ' + rootState.auth.jwtToken } })
console.log(dayStart)
const [h, m, s] = dayStart.split(':') const [h, m, s] = dayStart.split(':')
let begin = parseFloat(h) * 3600 + parseFloat(m) * 60 + parseFloat(s) let begin = parseFloat(h) * 3600 + parseFloat(m) * 60 + parseFloat(s)
console.log(begin)
if (response.data) { if (response.data && response.data.program) {
for (const item of response.data.program) { for (const item of response.data.program) {
item.begin = begin item.begin = begin
begin += (item.out - item.in) begin += (item.out - item.in)
} }
console.log(response.data) commit('UPDATE_PLAYLIST', response.data.program)
commit('UPDATE_PLAYLIST', response.data)
} }
} }
} }