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
0171a1b3
Commit
0171a1b3
authored
Apr 24, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
refactoring
parent
a9f27418
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/FileManager.vue
View file @
0171a1b3
...
...
@@ -251,7 +251,7 @@ export default {
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
},
}).
then
(
this
.
fetch
Show
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
this
.
fetch
File
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
...
...
@@ -266,7 +266,7 @@ export default {
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
}
}).
then
(
this
.
fetch
Show
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
this
.
fetch
File
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
...
...
@@ -279,7 +279,7 @@ export default {
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
}
}).
then
(
response
=>
{
this
.
startUpload
(
response
.
data
.
id
)
this
.
fetch
Show
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
this
.
fetch
File
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
...
...
@@ -344,7 +344,7 @@ export default {
// set the current show and its ID to whatever we want to switch to now
this
.
currentShow
=
index
this
.
currentShowID
=
this
.
shows
[
this
.
currentShow
].
id
this
.
fetchShow
s
(
this
.
shows
[
this
.
currentShow
].
slug
)
this
.
fetchShow
(
this
.
shows
[
this
.
currentShow
].
slug
)
},
switchMode
:
function
(
mode
)
{
if
(
this
.
mode
!==
mode
)
{
...
...
@@ -355,9 +355,12 @@ export default {
}
}
},
fetchShows
:
function
(
slug
)
{
fetchShow
:
function
(
slug
)
{
this
.
fetchFiles
(
slug
)
this
.
fetchPlaylists
(
slug
)
},
fetchFiles
:
function
(
slug
)
{
this
.
loaded
.
files
=
false
this
.
loaded
.
playlists
=
false
var
uri
=
process
.
env
.
VUE_APP_API_TANK
+
'
shows/
'
+
slug
+
'
/files
'
axios
.
get
(
uri
,
{
withCredentials
:
true
,
...
...
@@ -370,7 +373,10 @@ export default {
}).
catch
(
error
=>
{
alert
(
'
There was an error fetching files from tank:
'
+
error
)
})
uri
=
process
.
env
.
VUE_APP_API_TANK
+
'
shows/
'
+
slug
+
'
/playlists
'
},
fetchPlaylists
:
function
(
slug
)
{
this
.
loaded
.
playlists
=
false
var
uri
=
process
.
env
.
VUE_APP_API_TANK
+
'
shows/
'
+
slug
+
'
/playlists
'
axios
.
get
(
uri
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
}
...
...
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