Skip to content
Snippets Groups Projects
statistics.ts 370 B
Newer Older
  • Learn to ignore specific revisions
  • import axios from 'axios'
    import { AppDispatch } from './../store'
    import Types from './types'
    
    export const getStatistics = () => async (dispatch: AppDispatch) => {
      await axios
        .get('/api/misc/statistics')
        .then((res) => {
          dispatch({
            type: Types.SET_STATISTICS,
            payload: res.data,
          })
        })
        .catch((err) => console.log(err))
    }