import axios from 'axios'

const api = axios.create({ baseURL: '/api/service-auto' })

api.interceptors.request.use(config => {
  const token = localStorage.getItem('access_token')
  if (token) config.headers.Authorization = `Bearer ${token}`
  return config
})

export default {
  getFirme:   () => api.get('/firme'),
  getTipDeviz: () => api.get('/tip-deviz'),
  getMasini:  () => api.get('/masini'),
  creeazaComanda: (data) => api.post('/comenzi', data),
}
