mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-19 11:45:01 +00:00
upload file into request folder and get their thumbnails
This commit is contained in:
+6
-1
@@ -169,7 +169,7 @@ const actions = {
|
||||
if (percentCompleted >= 100) commit('PROCESSING_FILE', true)
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
.then(async (response) => {
|
||||
resolve(response)
|
||||
|
||||
// Proceed if was returned database record
|
||||
@@ -179,6 +179,11 @@ const actions = {
|
||||
// Remove first file from file queue
|
||||
commit('SHIFT_FROM_FILE_QUEUE')
|
||||
|
||||
// Refresh request detail to update currentFolder in Vuex
|
||||
if (router.currentRoute.name === 'RequestUpload' && !getters.currentFolder) {
|
||||
await dispatch('getUploadRequestDetail')
|
||||
}
|
||||
|
||||
// Check if user is in uploading folder, if yes, than show new file
|
||||
if (
|
||||
(!getters.currentFolder && !response.data.data.attributes.parent_id) ||
|
||||
|
||||
+17
-1
@@ -8,7 +8,23 @@ const defaultState = {
|
||||
uploadRequest: undefined,
|
||||
}
|
||||
|
||||
const actions = {}
|
||||
const actions = {
|
||||
getUploadRequestDetail: ({ commit, getters }) => {
|
||||
|
||||
axios.get(`/api/upload-request/${router.currentRoute.params.token}`)
|
||||
.then((response) => {
|
||||
|
||||
commit('LOADING_STATE', { loading: false, data: [] })
|
||||
|
||||
commit('SET_UPLOAD_REQUEST', response.data)
|
||||
|
||||
// Set current folder if exist
|
||||
if (response.data.data.relationships.folder) {
|
||||
commit('SET_CURRENT_FOLDER', response.data.data.relationships.folder)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
SET_UPLOAD_REQUEST(state, payload) {
|
||||
|
||||
@@ -189,11 +189,8 @@ export default {
|
||||
events.$on('context-menu:current-folder', (folder) => (this.item = folder))
|
||||
events.$on('mobile-context-menu:show', (item) => (this.item = item))
|
||||
|
||||
//this.$store.dispatch('getFolder', this.$route.params.id)
|
||||
this.$store.commit('LOADING_STATE', { loading: false, data: [] })
|
||||
this.$store.dispatch('getUploadRequestDetail')
|
||||
|
||||
axios.get(`/api/upload-request/${this.$router.currentRoute.params.token}`)
|
||||
.then((response) => this.$store.commit('SET_UPLOAD_REQUEST', response.data))
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user