This commit is contained in:
j3d1 2023-07-01 17:21:32 +02:00
parent cc3fec7347
commit 4140214c81
5 changed files with 206 additions and 4 deletions

View file

@ -250,11 +250,13 @@ export default createStore({
state.last_load.files = Date.now()
return data
},
async pushFile({state, dispatch, getters}, {file}) {
async pushFile({state, dispatch, getters}, {item_id, file}) {
const servers = await dispatch('getHomeServers')
const data = await servers.post(getters.signAuth, '/api/files/', file)
state.files.push(data)
return data
const data = await servers.post(getters.signAuth, '/api/item_files/'+item_id+'/', file)
if (data.mime_type) {
state.files.push(data)
return data
}
},
async fetchTags({state, commit, dispatch, getters}) {
if (state.last_load.tags > Date.now() - 1000 * 60 * 60 * 24) {