Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
531b6ccb
Commit
531b6ccb
authored
May 23, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FIX: update playlists table after edit
parent
38fb3e27
Pipeline
#384
failed with stages
in 1 minute and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/FileManager.vue
View file @
531b6ccb
...
...
@@ -788,11 +788,14 @@ export default {
return
null
},
// Returns a playlist object from the playlists array, given a playlist ID
getPlaylistById
:
function
(
id
)
{
// Returns a playlist object from the playlists array, given a playlist ID.
// If the mode parameter is used and set to 'index', then the playlists
// index in the playlist array is returned instead of the object
getPlaylistById
:
function
(
id
,
mode
)
{
for
(
var
i
in
this
.
playlists
)
{
if
(
this
.
playlists
[
i
].
id
===
id
)
{
return
this
.
playlists
[
i
]
if
(
mode
===
'
index
'
)
{
return
i
}
else
{
return
this
.
playlists
[
i
]
}
}
}
return
null
...
...
@@ -944,15 +947,14 @@ export default {
// when updating an existing playlist we use a PUT request and add the id
// of the playlist to the uri
}
else
if
(
this
.
playlistEditor
.
mode
===
'
edit
'
)
{
uri
+=
'
/
'
+
this
.
playlistEditor
.
id
var
id
=
this
.
playlistEditor
.
id
uri
+=
'
/
'
+
id
axios
.
put
(
uri
,
data
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
}
}).
then
(
response
=>
{
// TODO: seems to be not implemented in the tank yet
// update this as soon as tank has it implemented
//this.playlists.push(response.data)
console
.
log
(
response
.
data
)
this
.
playlists
[
this
.
getPlaylistById
(
id
,
'
index
'
)]
=
response
.
data
this
.
$refs
.
playlistsTable
.
refresh
()
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
+
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
console
.
log
(
error
.
response
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment