Skip to content
Snippets Groups Projects
roles.ts 357 B
Newer Older
  • Learn to ignore specific revisions
  • Carl Schönfelder's avatar
    Carl Schönfelder committed
    import axios from 'axios'
    import { AppDispatch } from './../store'
    import Types from './types'
    
    export const getRoles = () => async (dispatch: AppDispatch) => {
      await axios
        .get('/misc/roles')
        .then((res) => {
          dispatch({
            type: Types.SET_ROLES,
            payload: res.data.items,
          })
        })
        .catch((err) => console.log(err))
    }