add extensions

This commit is contained in:
Jonathan Baecker 2020-04-16 18:27:17 +02:00
parent 8b919695b0
commit 9830f5ac6a

View File

@ -17,11 +17,11 @@ export const mutations = {
}
export const actions = {
async getTree ({ commit, dispatch, state, rootState }, path) {
async getTree ({ commit, dispatch, state, rootState }, { extensions, path }) {
if ((path !== state.currentPath || !state.folderTree)) {
const crumbs = []
let root = '/'
const response = await this.$axios.get(`api/media/?path=${path}`, { headers: { Authorization: 'Bearer ' + rootState.auth.jwtToken } })
const response = await this.$axios.get(`api/media/?extensions=${extensions}&path=${path}`, { headers: { Authorization: 'Bearer ' + rootState.auth.jwtToken } })
if (response.data.tree) {
const pathArr = response.data.tree[0].split('/')