summaryrefslogtreecommitdiff
path: root/frontend/views/upload/upload.actions.js
blob: ba2b14bf2971d55cc4b111a3b8ca07ea2ce4b8fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as types from '../../types'
import { store, history } from '../../store'
import { api, post, pad, preloadImage } from '../../util'
import actions from '../../actions'
import { session } from '../../session'

export const upload = file => dispatch => {
  const formData = {
    'image': file,
    'username': session('username'),
  }
  // console.log(formData)
  return actions.upload.upload(formData).then(data => {
    // console.log(data.res)
    return data.res
  })
}